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

unable to change local user password via ADSI WinNT

$
0
0

Hi friends

i am exercising ADSI WinNT to manage local user accounts on my test win8.1 station.

i have a user named "mytestuser" & i want to change his password.

if i don't mistake i am wrong in line 2 (which is going to select that user). what should i write to select that user?

( note i don't want a one-line code, because i know the correct one-line form)

$cmp= [ADSI]"WinNT://$env:computername"
$user=$cmp.("user","mytestuser")     # i think this line is false. is it ?
$user.SetPassword("P@ssword")

thanks in advanced

 

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles