Add New Directory Services Connectors - QlikProfessionalServices/QlikView-CLI GitHub Wiki
First of all we need to connect to the QlikView Server
$Connection = Connect-QlikView
then we need to get the current DSP Configuration using the command
$DSPSettings = Get-QVDSPAPISettings
Next we create the new DS Resource we want to add
Supported types:
- AD
- Custom
- Ldap
- Local
- NT
- ODBC
Create the new resource using the command: (substituting values as required)
$NewQVDSResource = New-QVDSResource -Dsresourcetype AD -Username "Domain\UserName" -Password "ClearTextPassword" -Path "LDAP://Domain.com"
for readability you may want to splat this comand
$Credential = Get-Credential
$paramNewQVDSResource = @{
Dsresourcetype = 'AD'
Username = $Credential.UserName
Password = $Credential.GetNetworkCredential().Password
Path = "LDAP://sub.home.nillth.net"
}
$NewQVDSResource = New-QVDSResource @paramNewQVDSResource
Then we add the new resource to the current settings
$DSPSettings.Resources.Add($NewQVDSResource)
And finally save the updated settings back to the server.
Set-QVDSPAPISettings -Dspsettings $DSPSettings
Create a New AD Connection
#Connect via the QlikView APIs
$Connection = Connect-QlikView
#Get the DSP Settings
$DSPSettings = Get-QVDSPAPISettings
$Credential = Get-Credential
$paramNewQVDSResource = @{
Dsresourcetype = 'AD'
Username = $Credential.UserName
Password = $Credential.GetNetworkCredential().Password
Path = "LDAP://sub.home.nillth.net"
}
$NewQVDSResource = New-QVDSResource @paramNewQVDSResource
$DSPSettings.Resources.Add($NewQVDSResource)
Set-QVDSPAPISettings -Dspsettings $DSPSettings
Create multiple new connections
#Connect via the QlikView APIs
$Connection = Connect-QlikView
#Get the DSP Settings
$DSPSettings = Get-QVDSPAPISettings
#Create first new DS Resource
$NewQVDSResource = New-QVDSResource -Dsresourcetype AD -Username "Domain\UserName" -Password "ClearTextPassword" -Path "LDAP://Domain.com"
#Add the new Reource to the Settings
$DSPSettings.Resources.Add($NewQVDSResource)
#Create another new DS Resource
$NewQVDSResource2 = New-QVDSResource -Dsresourcetype Ldap -Username "SubDomain\UserName" -Password "ClearTextPassword" -Path "LDAP://SubDomain.com"
#Add the next Reource to the Settings
$DSPSettings.Resources.Add($NewQVDSResource2)
#Save the updated settings back to QlikView
Set-QVDSPAPISettings -Dspsettings $DSPSettings