New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update-QlikUser is not working #133
Comments
The following will import the CSV file. The Values that you are applying to the user must exist in the Custom Property Definition.
|
Thanks a lot @Nillth for helping . |
Hi All, |
From the Custom Property Definition? or from the applied values on a object? |
Let me give an example here- This we have to do for around 700 users. |
Hi @Nillth , |
as per the original request the column names are the same
and for the file name
throughout the code you can see references to the Properties imported from the CSV
|
Thanks @Nillth for your response. I get this error when I use the above code. Can you please assist? Update-QlikUser : Cannot process argument transformation on parameter 'id'. Cannot convert value to type System.String.
|
Hi @Nillth , |
also, what happens if there are two same ID's, but from different domains but belonging to the same person. |
Hello @Nillth or anyone who could assist :) I am unable to figure out how to fix this error, and would appreciate your help. The issue seems to be with the ID. I get an error when I do the Print, but returns values when I do Echo. Any thoughts? |
The Get-QlikUser command on line 27 is returning more than one user object. You could do the following to parse each user in the array, or modify the Get-QlikUser command to filter on the userdirectory as well Foreach($user in $QSuser){
Update-QlikUser -id $user.id -.....
} Edit: Autocorrect on mobile |
If you just want to update a single user then you should extend the filter to include the userDirectory so that only one user is returned. You can use a filter like this Alternatively, if you want to update all the matching users then you can use pipelining, in this case you would change the update command to |
The code is working, but it seem it can assign only one customproperty to a user. It is able to read all the users, and assigning the last customproperty from the csv file. For example, if the csv file includes Userid, Customproperty Only the CustomProperty of 'Operations Monitor' is assigned to the user 1234, and not both. Here is the updated code after adding your inputs. Appreciate any input to add multiple custom properties to users.
|
You need to filter the list of properties that you assign to each user to only include those that are not already assigned, otherwise you will be appending the same property and value multiple times. Since all the new and existing properties are being combined into a list of strings in the format "key=value", you could just filter this list to unique values using Select-Object. |
Thanks for your response @ahaydon Is this the correct place to add the filter? $UCP = $CSVUsers.Customproperty|Select-Object -Unique |
@ahaydon :) |
Hi All
Update-QlikUser is not updating the value when I import the values from csv(delimiter is ,) .I have two column in csv userid & custom property
Userid, Customproperty
1234, StreamReadManagement=testread
There is only one custom property already exist for this user (StreamWriteManagement=testwrite)
after appending the string returned is StreamReadManagement=testreadStreamWriteManagement=testwrite which is not accepted by Update-QlikUser.
since it accepts the values in StreamReadManagement=testread StreamWriteManagement=testwrite
any help is much appreciated
The text was updated successfully, but these errors were encountered: