Password rotation does not work for Windows 2012 R2

####################
#
# Windows 2012 R2 password rotation via administrator account template
#

@list_format=$username:$password
@list_item_prefix=""
@list_separator="\", \""

#
######################

$array = @("$user_password_list")
foreach ($userpw in $array) {
$upwArray =$userpw.Split(":")
$username ="WinNT://./" +$upwArray[0]
([ADSI]$username).SetPassword($upwArray[1])
}

Was this page helpful?