Powershell Scripting Request
the above set-aduser cmdlet syntax incorrect. correct syntax "changepasswordatlogon".
ie set-aduser username -changepasswordatlogon $true
( tested , works ).
you may have check "passwordneverexpires" etc "get-aduser username -properties passwordneverexpires"
.
, "cannotchangepassword" property
get-aduser username -properties cannotchangepassword
and set them required via powershell or gui.
can use "set-aduser username -passwordneverexpires $false" etc
see below
ble[bool]>] [-certificates <hashtable>] [-changepasswordatlogon <system.nullable[bool]>] [-city <string>] [-clear <string[]>] [-company <string>] [-country <string>] [-department <string>] [-description <string>] [-displayname <string>] [-division <string
>] [-emailaddress <string>] [-employeeid <string>] [-employeenumber <string>] [-enabled <system.nullable[bool]>] [-fax <string>] [-givenname <string>] [-homedirectory <string>] [-homedrive <string>] [-homepage <string>] [-homephone <string>] [-initials <s
tring>] [-logonworkstations <string>] [-manager <aduser>] [-mobilephone <string>] [-office <string>] [-officephone <string>] [-organization <string>] [-othername <string>] [-passwordneverexpires <system.nullable[bool]>] [-passwordnotrequired <system.nulla
ble[bool]>] [-pobox <string>] [-postalcode <string>] [-profilepath <string>] [-remove <hashtable>] [-replace <hashtable>] [-samaccountname <string>] [-scriptpath <string>] [-serviceprincipalnames <hashtable>] [-smartcardlogonrequired <system.nullable[bool
]>] [-state <string>] [-streetaddress <string>] [-surname <string>] [-title <string>] [-trustedfordelegation <system.nullable[bool]>] [-userprincipalname <string>] [-authtype {negotiate | basic}] [-credential <pscredential>] [-partition <string>] [-passth
ru <switch>] [-server <string>] [-confirm] [-whatif] [<commonparameters>]
just code, no beer...although help..
Windows Server > Windows PowerShell
Comments
Post a Comment