Finding users whose password is set to never expiry.
To export the user's whose attributes are set for password never expiry through powershell cmdlets.
Please use the below commands.
Get-ADUser -Filter 'PasswordNeverExpires -eq $true' -Server "domain name" | select name > c:\users.txt
Here we have used Get-aduser cmdlets and filter to show all users whose password is
Set to enabled.
We’re piping the output with cmdlets “select-object” and to show the output with “Name” attribute.
Note:-
o Run powershell as administrator
o Import-module activedirectory
o Set-execution policy unrestricted
0 comments:
Post a Comment