Powershell Scripting Request


i new scripting, , need helping developing powershell script update user's profiles "user must change password @ next logon"  i have cvs file 2000 users (display name) , script process user every hour.  any assistance appreciated...

 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

set-aduser [-identity] <aduser> [-accountexpirationdate <system.nullable[system.datetime]>] [-accountnotdelegated <system.nullable[bool]>] [-add <hashtable>] [-allowreversiblepasswordencryption <system.nullable[bool]>] [-cannotchangepassword <system.nulla
    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

Popular posts from this blog

Azure MFA with Azure AD and RDS

Failed to setup initiator portal. Error status is given in the dump data.

Invalid pointer on gpresult /h gpreport.html