powershell calling cpw - white space in password problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

powershell calling cpw - white space in password problem

Ramaiah, Vanna G.
I have a non-interactive powershell that changes password using cpw. It works fine. When the password contain white space character in it, it fails because it sees white space as delimiter.

The following command works fine. The part -q is in single quotes. If there is a space in UserPassword it fails. How to overcome this problem?

$processStartInfo.Arguments ="" + $server + " -l " + $AdminUserName + " -pw " + $AdminPassword + " -v " +" /usr/bin/kadmin -p " + $AdminUserName + "/admin -w " + $AdminPassword + " -q 'cpw -pw " + $NewUserPassword + " " + $PrincipalName +"'"
$processStartInfo.Arguments = ServerName -l AdminAccount -pw AdminPassword -v  /usr/bin/kadmin -p AdminAccount/admin -w AdminPassword -q 'cpw -pw UserPassword UserAccount'













-------------------------------------------------------------------------
This message was secured via TLS by MUSC.
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos
Reply | Threaded
Open this post in threaded view
|

RE: powershell calling cpw - white space in password problem

Ramaiah, Vanna G.
The following 2 works fine.

ServerName -l AdminAccount -pw AdminPassword -v  /usr/bin/kadmin -p AdminAccount/admin -w AdminPassword -q 'cpw -pw UserPassword UserAccount'

ServerName -l AdminAccount -pw AdminPassword -v  /usr/bin/kadmin -p AdminAccount/admin -w AdminPassword -q 'cpw -pw "UserPassword" UserAccount'

The following does work.

ServerName -l AdminAccount -pw AdminPassword -v  /usr/bin/kadmin -p AdminAccount/admin -w AdminPassword -q 'cpw -pw "User Password" UserAccount'















-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ramaiah, Vanna G.
Sent: Wednesday, October 11, 2017 5:37 PM
To: [hidden email]
Subject: powershell calling cpw - white space in password problem







I have a non-interactive powershell that changes password using cpw. It works fine. When the password contain white space character in it, it fails because it sees white space as delimiter.



The following command works fine. The part -q is in single quotes. If there is a space in UserPassword it fails. How to overcome this problem?



$processStartInfo.Arguments ="" + $server + " -l " + $AdminUserName + " -pw " + $AdminPassword + " -v " +" /usr/bin/kadmin -p " + $AdminUserName + "/admin -w " + $AdminPassword + " -q 'cpw -pw " + $NewUserPassword + " " + $PrincipalName +"'"

$processStartInfo.Arguments = ServerName -l AdminAccount -pw AdminPassword -v  /usr/bin/kadmin -p AdminAccount/admin -w AdminPassword -q 'cpw -pw UserPassword UserAccount'



























-------------------------------------------------------------------------

This message was secured via TLS by MUSC.

________________________________________________

Kerberos mailing list           [hidden email]<mailto:[hidden email]>

https://mailman.mit.edu/mailman/listinfo/kerberos




-------------------------------------------------------------------------
This message was secured via TLS by MUSC.
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos
Reply | Threaded
Open this post in threaded view
|

Re: powershell calling cpw - white space in password problem

Greg Hudson
In reply to this post by Ramaiah, Vanna G.
On 10/11/2017 05:36 PM, Ramaiah, Vanna G. wrote:
> I have a non-interactive powershell that changes password using cpw. It works fine. When the password contain white space character in it, it fails because it sees white space as delimiter.

kadmin -q 'cpw -pw "a b" user' works for me; I'm not certain why it
isn't working for you.

In MIT krb5 1.14 and later, you can also omit the -q option and just write:

  kadmin -p AdminAccount/admin -w AdminPassword cpw -pw "a b" user

This form bypasses the internal word-splitting logic and lets you
specify each word of the command as a separate argument value.
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos