PowerShell on Target Machine: Special Characters in password
See original GitHub issueI am running into an issue where my admin password contain special characters. As a result, when executing the script, the authentication fails.
password - %D0`H\vW’RUc?buZ5
While I could, and probably will, in the short term, update the password to remove special characters, I wanted to bring this issue to your attention. With password policies becoming more robust, it is only a matter of time, if not already, before this becomes an issue for others.
Error log excerpt: 2016-11-03T15:38:46.6387093Z Deployment status for machine ‘ServerRemoved:5985’ : ‘Failed’ 2016-11-03T15:38:46.6543337Z ##[debug]System.Exception: AuthorizationManager check failed. 2016-11-03T15:38:46.6699590Z ##[error]AuthorizationManager check failed.
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (9 by maintainers)
Top Results From Across the Web
the use of $ and other special characters in the password
PowerShell : the use of $ and other special characters in the password. Consideration must be given when passing passwords that contain special...
Read more >Escaping all password special characters in Powershell for ...
Escaping all password special characters in Powershell for Variable - Stack Overflow. Stack Overflow for Teams – Start collaborating and ...
Read more >Passing passwords which contain special characters on ...
Passing passwords which contain special characters on the command line. Section: Login issues Updated: August 05, 2020 10:53.
Read more >Passing Variables with Special Characters (Passwords)
Is there a way to pass this value, or similar values with special characters, without having powershell blow up?
Read more >Create a Process file
Use a backslash, '\', before the following special characters in the action: {, }, [, ], \, $. SpawnCopy bookmark. This action type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using the following appears to work in the test listed above. $securePassword = ConvertTo-SecureString ‘%D0`H\vW’‘RUc?buZ5’ -AsPlainText -Force
note that I changed the double quotes to a single quote and escaped the single quote within the password
Feel its my luck day today. After banging my head for past 8 hours on this I could finally work this through using Stop-Script character in PowerShell ‘–%’
Solution I tried:
.\config.cmd --deploymentgroup --deploymentgroupname DeployGroupCTS --agent $env:COMPUTERNAME --runasservice --work '_work' --adddeploymentgrouptags --deploymentgrouptags $CTS --url 'https://dev.azure.com/campusmgmt-product-development/' --projectname 'Student' --auth PAT --token u4bq6j************************************hhyq --windowsLogonAccount $(ServiceAccountUser) --windowsLogonPassword --% "$(Service_Account_Password)" %;%
Ref: https://stackoverflow.com/questions/18923315/using-in-powershell
Hope this might helps others.