Last active
March 11, 2022 00:58
-
-
Save StephenFerrero/d8b5623f2c198a5ed9ecacd281d82b94 to your computer and use it in GitHub Desktop.
Get list of AD Users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module Active Directory | |
Get-ADUser -Properties * -LDAPFilter '(name=*)' -SearchBase "OU=Employees,OU=CON - User Accounts,DC=contoso,DC=com" | Select Name , SamAccountName , LastLogonDate | Export-Csv C:\Users.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment