cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1770
Views
0
Helpful
3
Replies

Powertools - setting password with $ symbol fails

derek.robertson
Level 1
Level 1

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

3 Replies 3

tcerling
Level 4
Level 4

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.

Thanks Timothy that's what I was afraid of 

$ symbols are allowed when settings passwords through the CIMC gui / cli.

I will let engineering know.

tim

Review Cisco Networking products for a $25 gift card