mbegan / Okta-PSModule

Okta API Powershell Wrapper Module
Other
102 stars 31 forks source link

Cannot validate argument on parameter 'uid'. The character length of the 27 argument is too long. #61

Open platinum-dummy opened 2 years ago

platinum-dummy commented 2 years ago

Hello! I have followed basic setup instructions. I have copied the files into my correct path, imported okta module into my session and I can successfully view data on a user by running: oktaGetUserbyID -oOrg prod -uid username@domain.com

When I attempt to deactivate this user: oktaDeactivateUserbyID -oOrg prod -uid username@domain.com I get the following error:

oktaDeactivateUserbyID : Cannot validate argument on parameter 'uid'. The character length of the 27 argument is too long. Shorten the character length of the argument so it is fewer than or equal to "20" characters, and then try the command again.

Any thoughts would be appreciated.

Thank you

J-Nistler commented 1 year ago

Hey @platinum-dummy ! I know this is super old, but I ran into something similar. This is what I found out:

The "uid" is only the user's email address for the "oktaGetUserbyID" function. For most other functions, the "uid" attribute is the unique identifier that Okta assigns a user. To find that, first run a "oktaGetUserbyID" command with the email address as the uid for that function. Look at the results that are returned - the first attribute returned is called "id" and is a 20 digit number that is unique to the user. That is the 20 digit ID number that you will pass the other functions (like oktaDeactivateUserbyID).