powershell calling cpw - white space in password problem
Ramaiah, Vanna G.
ramaiah at musc.edu
Wed Oct 11 17:51:27 EDT 2017
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: kerberos-bounces at mit.edu [mailto:kerberos-bounces at mit.edu] On Behalf Of Ramaiah, Vanna G.
Sent: Wednesday, October 11, 2017 5:37 PM
To: kerberos at mit.edu
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 Kerberos at mit.edu<mailto:Kerberos at mit.edu>
https://mailman.mit.edu/mailman/listinfo/kerberos
-------------------------------------------------------------------------
This message was secured via TLS by MUSC.
More information about the Kerberos
mailing list