Created
August 9, 2021 22:07
-
-
Save Rugby-Ball/c728f4d5eee3a87597e6439707858507 to your computer and use it in GitHub Desktop.
This will get all of the Computers in an AD, and display the Server name, the Distinguished Name and the Groups the computer is a Member of. (groups they are in) #Inventory #Active_Directory
This file contains hidden or 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
| #This will get all of the Computers in an AD, and display the Server name, the Distinguished Name and the Groups the computer is a Member of. (groups they are in) | |
| ((Get-ADComputer -Filter *).samaccountname).trimend("$") | Get-ADComputer -Properties memberOf | Select-Object -Property @{N= "Name";E= {($_.samaccountname).trimend("$")}}, @{N= "Distinguished_Name";E= {$_.DistinguishedName}}, @{N= "Groups";E={$_.Memberof}} | Sort Name | Out-GridView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment