powershell calling cpw - white space in password problem

Ramaiah, Vanna G. ramaiah at musc.edu
Wed Oct 11 17:36:59 EDT 2017


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.


More information about the Kerberos mailing list