Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Changing a user's password.

$
0
0

I'm reading in a csv file with the properties being a SAMAccountName and a password. Then for each user I change their password using the command:

 

Set-ADAccountPassword-Identity$User.SAMAccountName-NewPassword (ConvertTo-SecureString-String$User.Password-AsPlainText-Force) -Reset-ErrorAction Stop

 

Will anything go wrong if the password has a $, apostrophe, quote, or backtick in it? Here's an example of the csv file: 

name,password

dvs.foo1,foddy$bob

dvs.foo2,'hello`r'World'

dvs.foo3,my"name"i$bob`n

Do Windows passwords allow these characters?


Viewing all articles
Browse latest Browse all 6937

Trending Articles