HomeDocumentationAPI Reference
Log In
These docs are for v24. Click to read the latest docs for v33.

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])
}