export AD users with password never expire to csv file

%3CLINGO-SUB%20id%3D%22lingo-sub-2246114%22%20slang%3D%22en-US%22%3Eexport%20AD%20users%20with%20password%20never%20expire%20to%20csv%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2246114%22%20slang%3D%22en-US%22%3E%3CP%3Eany%20script%20to%20export%20AD%20users%20with%20password%20never%20expire%20to%20csv%20file%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2246114%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EActive%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EManagement%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2425838%22%20slang%3D%22en-US%22%3ERe%3A%20export%20AD%20users%20with%20password%20never%20expire%20to%20csv%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2425838%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F61448%22%20target%3D%22_blank%22%3E%40Marvin%20Oco%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Etry%20this%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3ESearch-ADAccount%20-PasswordNeverExpires%20-UsersOnly%20-ResultPageSize%202000%20-resultSetSize%20%24null%20%7C%20Select-Object%20Name%2C%20SamAccountName%2C%20DistinguishedName%20%7C%20Export-CSV%20%E2%80%9CC%3A%5CTemp%5CPassNeverExpiresUsers.CSV%E2%80%9D%20-NoTypeInformation%3C%2FPRE%3E%3CP%3EBest%20regards%2C%3CBR%20%2F%3ESchnittlauch%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22First%2C%20No%20system%20is%20safe.%20Second%2C%20Aim%20for%20the%20impossible.%20Third%20no%20Backup%2C%20no%20Mercy%22%20-%20Schnittlauch%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20answer%20helped%20you%3F%20Don't%20forget%20to%20leave%20a%20like.%20Also%20mark%20the%20answer%20as%20solved%20when%20your%20problem%20is%20solved.%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Super Contributor

any script to export AD users with password never expire to csv file

 

thanks

1 Reply

Hi @Marvin Oco,

 

try this

 

Search-ADAccount -PasswordNeverExpires -UsersOnly -ResultPageSize 2000 -resultSetSize $null | Select-Object Name, SamAccountName, DistinguishedName | Export-CSV “C:\Temp\PassNeverExpiresUsers.CSV” -NoTypeInformation

Best regards,
Schnittlauch

 

"First, No system is safe. Second, Aim for the impossible. Third no Backup, no Mercy" - Schnittlauch

 

My answer helped you? Don't forget to leave a like. Also mark the answer as solved when your problem is solved. :)