Powertools - setting password with $ symbol fails

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2016 05:52 AM
Hi all,
I'm trying to set the password for IMC user account using the IMC Powertools.
It will not accept a dollar $ symbol in the password - I've tried to escape this in different ways they all throw up a regex error.
Does anyone know a way around this please ?
$pwd = "testPwd`$101"
or
$pwd = 'testPwd$101'
Get-ImcLocalUser -Imc $imc -Name "admin" | Set-ImcLocalUser -Pwd $pwd -AccountStatus "active" -Priv "admin" -Force
Set-ImcLocalUser : Cannot validate argument on parameter 'Pwd'. The argument
"testPwd$101" does not match the
"^[!"#%&'\(\)\*\+,\-\./:;<>@\[\\\]\^_`\{\|\}~a-zA-Z0-9]{0,20}$" pattern.
Supply an argument that matches
"^[!"#%&'\(\)\*\+,\-\./:;<>@\[\\\]\^_`\{\|\}~a-zA-Z0-9]{0,20}$" and try the
command again.
At line:1 char:66
+ Get-ImcLocalUser -Imc $imc -Name "admin" | Set-ImcLocalUser -Pwd $pwd
-AccountSt ...
+ ~~~~
+ CategoryInfo : InvalidData: (:) [Set-ImcLocalUser], ParameterBi
ndingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Cisco.Imc.Cmdle
ts.SetImcLocalUser
- Labels:
-
Unified Computing System (UCS)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2016 08:35 AM
Looks like the regular expression for the password field does not allow for a '$' character. The expression would need to include '\$' in the string. I made that change to the regular expression in a test PowerShell script and the regular expression accepts your password.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2016 08:56 AM
Thanks Timothy that's what I was afraid of
$ symbols are allowed when settings passwords through the CIMC gui / cli.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2016 09:05 AM
I will let engineering know.
tim
