Created
November 24, 2016 02:52
-
-
Save at0dd/608c394180a8c89471a7c06215fdac24 to your computer and use it in GitHub Desktop.
Exports information from Active Directory
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
#Exports all computers from Active Directory to a CSV file on your desktop. | |
Import-Module ActiveDirectory | |
Get-ADComputer -Filter * -Property * | Export-CSV "$env:userprofile\Desktop\Computers.csv" -NoTypeInformation -Encoding UTF8 |
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
#Exports all groups from Active Directory to a CSV file on your desktop. | |
Import-Module ActiveDirectory | |
Get-ADGroup -Filter * -Properties * | Export-CSV "$env:userprofile\Desktop\Groups.csv" -NoTypeInformation -Encoding UTF8 |
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
#Exports all users from Active Directory to a CSV file on your desktop. | |
#Add "| Where-Object {$_.DistinguishedName -notlike "*CN=CN Name,DC=comp,DC=company,DC=com"}" before "| Export-CSV" to filter out an OU. | |
Import-Module ActiveDirectory | |
Get-ADUser -Filter * -Properties * | Export-CSV "$env:userprofile\Desktop\Users.csv" -NoTypeInformation -Encoding UTF8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment