Modify PwdLastSet for testing
$ID= "CN=testaccount,OU=Datacenter,DC=coolDomain,DC=COM"
Set-ADUser -Identity "$ID" -Replace @{pwdlastset="0"}
Set-ADUser -Identity "$ID" -Replace @{pwdlastset="-1"}
get-aduser $ID -property passwordlastset, passwordneverexpires
Update ExtensionAttribute 14 and Description
$services = Get-Content -Path "D:\psExports\LISTS\service_accounts.txt"
Foreach ($s in $services) {
Set-AdUser $s -Clear "Description"
Set-AdUser $s -Add @{Description = "Owner - Bob Snobb"}
Set-AdUser $s -Clear "ExtensionAttribute14"
Set-AdUser $s -Add @{ExtensionAttribute14 = "bsnobb"}
}
Overwrite and update the account description. With your DA account, set user account attributes.
Set-AdUser -Clear "Description"
Set-AdUser -Add @{Description = "Owner - Sally Snoot"}
Same but with an extensionAttribute
Set-AdUser -Clear "ExtensionAttribute14"
Set-AdUser -Add @{ExtensionAttribute14 = "Sally Snoot"}
Various other examples…
Set-ADUser -Identity jwilliams -PasswordNeverExpires $true
Set-ADUser da.jwilliams -ChangePasswordAtLogon $False