I’m often looking up workstation and/or server details. This can be tedious if I have to open up Active Directory Users and Computers and Find every time. PowerShell to the rescue! If I don’t know the exact name, something I use often is the -Filter parameter from the Get-ADComputer cmdlet.
Get-ADComputer -Filter {name -like '*a*'}
PS C:\Users\azureadmin> Get-ADComputer -Filter {name -like '*a*'}
DistinguishedName : CN=ca1,CN=Computers,DC=timhaintz,DC=com
DNSHostName : ca1.timhaintz.com
Enabled : True
Name : ca1
ObjectClass : computer
ObjectGUID : 3d0102ae-11fd-4f3c-8f72-a67356b46c61
SamAccountName : CA1$
SID : S-1-5-21-493708430-333671045-2630090032-1103
UserPrincipalName :
If you are using Windows 10, you will need to install Remote Server Administration Tools (RSAT) for Windows 10 and then enable RSATClient-Roles-AD-Powershell before you can access the ActiveDirectory Module cmdlets. Install the Active Directory PowerShell Module on Windows 10 by Ashley McGlone has a scriptable way to install RSAT.
Get-WindowsOptionalFeature -Online -FeatureName RSATClient-Roles-AD-Powershell
Thanks, Tim.