Add New Directory Services Connectors - QlikProfessionalServices/QlikView-CLI GitHub Wiki

Add New Directory Services Connectors

Connect via the QlikView APIs

First of all we need to connect to the QlikView Server

$Connection = Connect-QlikView

Get the current DSP Settings

then we need to get the current DSP Configuration using the command

$DSPSettings = Get-QVDSPAPISettings 

Create the new DS Resource

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

Add the new Reource to the Settings

Then we add the new resource to the current settings

$DSPSettings.Resources.Add($NewQVDSResource)

Update the Server Settings

And finally save the updated settings back to the server.

Set-QVDSPAPISettings -Dspsettings $DSPSettings

Example 1

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

Example 2

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
⚠️ **GitHub.com Fallback** ⚠️