Closed GaryJBlake closed 2 years ago
Error handling in the module is not good enough here. The real server error after debugging with http proxy is
Failed: cannot create person user for user TestAccount because password policy is not satisfied
Caused by: Constraint violation
The fix should be to expose the server error details to the user.
Version 1.3.8 on Windoiws PowerShell 7.0 works correct with the error handling:
> New-SsoPersonUser -UserName 'testuser' -Password 'd'
New-SsoPersonUser: One or more errors occurred. (The specified principal (testuser) is invalid.
Caused by: Another user or group already exists with the same name: accountName=testuser, principal=testuser@vsphere.local)
PS C:\Users\dmilov> New-SsoPersonUser -UserName 'testuser2' -Password 'd'
New-SsoPersonUser: One or more errors occurred. (Failed: cannot create person user for user testuser2 because password policy is not satisfied
Caused by: Constraint violation)
1.3.8 is available on PS Gallery
Describe the bug
When attempting to add a user to the SSO Domain using New-SsoPersonUser it throws an error 'One or more errors occurred'.
New-SsoPersonUser -UserName TestAccount -Password VMw@re1! -Server $ssoConnectionDetails
New-SsoPersonUser : One or more errors occurred. At line:1 char:1
Reproduction steps
Expected behavior
Account should be created without an error
Additional context
No response