question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PowerShell on Target Machine: Special Characters in password

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
goofy78270commented, Nov 23, 2016

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

2reactions
praharshpcommented, Apr 2, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found