-
-
Save mountaindude/8fd9b08ac6d1caddc034a93522fc511c to your computer and use it in GitHub Desktop.
Register a Qlik Node using Qlik CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Run on the Central | |
#> | |
# Connect to Qlik Sense | |
# See https://github.com/ahaydon/Qlik-Cli/wiki/Establishing-a-connection for more connection options | |
Connect-Qlik | |
# Add the Node to the Cluster; store the password element of the response for the ZIP as $password | |
# nodePurpose: 0 (Production) / 1 (Development) / 2 (Both) | |
# engineEnabled, proxyEnabled, schedulerEnabled, $printingEnabled, $failoverCandidate as options | |
$password = New-QlikNode -hostname qlikserver2.domain.local -name qlikserver2 -nodePurpose 0 -engineEnabled -proxyEnabled | |
# Build an array for the password; used later for a POST to the unlocking page | |
$foo = @{__pwd="$password"} | |
<# | |
Using this will allow a silent execution without password prompt | |
$Username = 'DOMAIN\Administrator' | |
$Password = 'Password123!' | |
$pass = ConvertTo-SecureString -AsPlainText $Password -Force | |
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass | |
Invoke-Command -ComputerName qlikserver2.domain.local -ScriptBlock { Invoke-WebRequest -Uri "http://localhost:4570/certificateSetup" -Method Post -Body $Using:foo } -credential $Cred | |
#> | |
Invoke-Command -ComputerName qlikserver2.domain.local -ScriptBlock { Invoke-WebRequest -Uri "http://localhost:4570/certificateSetup" -Method Post -Body $Using:foo } -credential DOMAIN\Administrator | |
# Filter by the name param from line 7 | |
$nodeid = Get-QlikNode -filter "(name eq 'qlikserver2')" | |
Invoke-QlikGet -path /qrs/servernoderegistration/start/$($nodeid.id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment