Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I would like to know if it is possible to connect to Qlik Sense API via Powershell and take the user email attribute.
I connected to URL https://<sense>:4242/qrs/user/full?xrfkey=12345678qwertyui"
I expanded the attributes field, like this: $variable | select -ExpandProperty attributes
At this point, I do not know how to take the name and email attributes from my Qlik Sense Environment users.
Does anyone know how to do that?
I appreciate any help you can provide.
Regards,
Marco
If you use QlikSenseCLI
https://github.com/QlikProfessionalServices/QlikSenseCLI/
you may find structuring these api calls much easier.
Based on what you are asking for, I suspect that Option 2 below may best suit your needs
#option 1
Connect-QlikSense -TrustAllCertificates -Hostname "ifRequired" -VirtualProxy "ifRequired"
$users = Get-QSUser -Full
foreach($user in $users){
$EmailAddress = $($user.Attributes|?{$_.AttributeType -eq "Email"}).Attributevalue
$EmailAddress
}
#option 2
Connect-QlikSense -TrustAllCertificates -Hostname "ifRequired" -VirtualProxy "ifRequired"
$users = Get-QSUser -Full
#Calculated properties
$users|Select-Object -Property id,Name,@{Name="Email";E={$($_.Attributes|?{$_.AttributeType -eq "Email"}).Attributevalue}}
If you use QlikSenseCLI
https://github.com/QlikProfessionalServices/QlikSenseCLI/
you may find structuring these api calls much easier.
Based on what you are asking for, I suspect that Option 2 below may best suit your needs
#option 1
Connect-QlikSense -TrustAllCertificates -Hostname "ifRequired" -VirtualProxy "ifRequired"
$users = Get-QSUser -Full
foreach($user in $users){
$EmailAddress = $($user.Attributes|?{$_.AttributeType -eq "Email"}).Attributevalue
$EmailAddress
}
#option 2
Connect-QlikSense -TrustAllCertificates -Hostname "ifRequired" -VirtualProxy "ifRequired"
$users = Get-QSUser -Full
#Calculated properties
$users|Select-Object -Property id,Name,@{Name="Email";E={$($_.Attributes|?{$_.AttributeType -eq "Email"}).Attributevalue}}