Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I am trying to query for all users with a custom attribute called "professional" = true, using Qlik-CLI
I am able to connect successfully, using certificates.
The command is as follows:
get-qlikuser -filter "professional eq true" -full
This produces the following error message:
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\1.19.1\functions\core.ps1:63 char:19
+ $result = Invoke-RestMethod @paramInvokeRestMethod @params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMetho
d], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCo
mmand
Any ideas what I'm doing wrong?
Thank you!
You're trying to filter on a custom property named professional, yes? If so then this would be the syntax:
Get-QlikUser -full -filter "@professional eq 'true'"
If not, then what is this attribute? A user attribute like a group? Something else?
@Levi_Turner I figured it out, this is what I needed.
$professionalattributeusers = Get-QlikUser -full -filter "attributes.attributeType eq 'professional' and attributes.attributeValue eq 'true'"
Write-Output $professionalattributeusers
Thanks!
You're trying to filter on a custom property named professional, yes? If so then this would be the syntax:
Get-QlikUser -full -filter "@professional eq 'true'"
If not, then what is this attribute? A user attribute like a group? Something else?
@Levi_Turner it is an attribute we've pulled in through SQL ODBC connector, like 'email' in this example
Running your code does not produce an error, so I assume it's working. However when I try to view the result nothing appears:
$professionalattributeusers = Get-QlikUser -full -filter "@professional eq 'true'"
Write-Output $professionalattributeusers
Even though in QMC, I can see two users with this attribute = true.
Not sure if i'm still doing something wrong..
@Levi_Turner I figured it out, this is what I needed.
$professionalattributeusers = Get-QlikUser -full -filter "attributes.attributeType eq 'professional' and attributes.attributeValue eq 'true'"
Write-Output $professionalattributeusers
Thanks!