Extract "pwdLastSet, Password expires, Password changeable, Password required, PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-2356967%22%20slang%3D%22en-US%22%3EExtract%20%22pwdLastSet%2C%20Password%20expires%2C%20Password%20changeable%2C%20Password%20required%2C%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2356967%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22lia-align-left%22%3E%3CFONT%20size%3D%223%22%20color%3D%22%230000FF%22%3EExtract%20%22Password%20Last%20set%2C%20Password%20expires%2C%20Password%20changeable%2C%20Password%20required%2C%20User%20may%20change%20password%22%20property%20for%20all%20Staff%20OU%20users%20and%20export%20to%20csv%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2356967%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2362581%22%20slang%3D%22en-US%22%3ERe%3A%20Extract%20%22pwdLastSet%2C%20Password%20expires%2C%20Password%20changeable%2C%20Password%20required%2C%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2362581%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1054527%22%20target%3D%22_blank%22%3E%40Billvel%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EDid%20you%20look%20into%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Factivedirectory%2Fget-aduser%3Fview%3Dwindowsserver2019-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGet-ADUser%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.utility%2Fexport-csv%3Fview%3Dpowershell-7.1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EExport-Csv%3C%2FA%3E%3F%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-ADUser%20-Filter%20*%20-SearchBase%20%22OU%3DStaff%2COU%3DUserAccounts%2CDC%3DFABRIKAM%2CDC%3DCOM%22-%20Properties%20*%20%7C%20Export-Csv%20-NoTypeInformation%20-Path%20Users%20report.csv%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EHope%20that%20helps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Extract "Password Last set, Password expires, Password changeable, Password required, User may change password" property for all Staff OU users and export to csv

1 Reply

Hello @Billvel,

Did you look into Get-ADUser and Export-Csv?

Get-ADUser -Filter * -SearchBase "OU=Staff,OU=UserAccounts,DC=FABRIKAM,DC=COM"- Properties * | Export-Csv -NoTypeInformation -Path Users report.csv

Hope that helps.