Get AD Computer Description Using Powershell - MorganTechSpace
Maybe your like
Before proceed, first run the below command to import Active Directory module.
Import-Module ActiveDirectorySummary
- Get description of all AD computers
- Apply filter to get computers by description
- Get description of computers from specific OU
- Get description for list of computers
Get description of all AD computers
The following command find and list the name and description of all the available computers in Active Directory.
Get-ADComputer -Filter * -Property Name,Description | Select -Property Name,DescriptionYou can also export the details to csv file by using the powershell cmdlet Export-CSV.
Get-ADComputer -Filter * -Property Name,DNSHostName,Description | Select -Property Name,DNSHostName,Description | Export-CSV "C:\AllComputers.csv" -NoTypeInformation -Encoding UTF8Apply filter to get computers by description
The Get-ADComputer cmdlet supports SQL like filter, we can easily use this filter to get only specific set of AD computers. The below script select all the computers whose description contains the text ‘SVR‘.
Get-ADComputer -Filter 'Description -like "*SVR*"' -Property Name,Description | Select -Property Name,DescriptionApply LDAP Filter to get set of AD computers:
If your are familiar with LDAP filter, instead of normal filter, you can also use LDAP filter with to select particular set of AD computers.
Get-ADComputer -LDAPFilter '(Description=*SVR*)' -Property Name,Description | Select -Property Name,DescriptionGet description of computers from specific OU
We can set target OU scope by using the parameter SearchBase to select computers from specific OU. The following powershell script select all computers from the Organization Unit ‘TestOU’ and export it to CSV file.
Get-ADComputer -Filter * -SearchBase "OU=TestOU,DC=TestDomain,DC=com"` -Property Name,DNSHostName,Description | ` Select -Property Name,DNSHostName,Description | ` Export-CSV "C:\TestOUComputers.csv" -NoTypeInformation -Encoding UTF8Get description for list of computers
The below powershell script gets description for list of AD computers. First create the text file computers.txt which includes one computer name in each line. You will get the name and description in the csv file ADComputers.csv.
Get-Content C:computers.txt | Get-ADComputer -Property Name,Description |` Select -Property Name,Description |` Export-CSV C:ADComputers.csv -NoTypeInformation -Encoding UTF8Share this:
- X
Related Posts
- Get all computers from OU in AD using PowerShell
- Get all users in AD group using Powershell
- PowerShell: How to Import Active Directory module
- Get AD User Home Directory using PowerShell
- Find AD Domain Controllers using Powershell
Leave a Comment Cancel reply
Comment
Name Email WebsiteSave my name, email, and website in this browser for the next time I comment.
Categories
- Powershell
- Microsoft 365
- Azure AD
- SharePoint Online
- Exchange Online
- Microsoft Teams
- Office 365 Groups
- Active Directory
- Microsoft Graph
- PnP-PowerShell
- CSOM
Recent Posts
- Get Azure AD (Entra ID) App-Only Access Token with PowerShell
- Working with REST API in PowerShell using Invoke-RestMethod
- M365 User SignIn Activity – Neither tenant is B2C or tenant doesn’t have premium license
- How to Join or Concatenate String and Number Using PowerShell
- Find Location and County by IP Address with PowerShell
- Microsoft 365
- Azure AD
- SharePoint Online
- Exchange Online
- Microsoft Teams
- Microsoft 365 Groups
- OneDrive for Business
- Azure AD Authentication
- Active Directory
- Exchange Server
- PowerShell
- PnP PowerShell
- Microsoft Graph
- CSOM
- VBScript
Follow us
Tag » Add Computer Description To Active Directory Powershell
-
Set-ADComputer (ActiveDirectory) - Microsoft Docs
-
New-ADComputer (ActiveDirectory) - Microsoft Docs
-
How To Automatically Fill The Computer Description In Active Directory?
-
Appending The Computer Description In AD - IDERA Community
-
Get AD Computer Description Using PowerShell - ShellGeek
-
Powershell AD Computer Description Append - Stack Overflow
-
Automatically Fill The Computer Description Field In Active Directory
-
How To Manage Computers In Active Directory Using PowerShell
-
I Am Trying To Update Computer Description In AD With Managed By ...
-
Edit Active Directory Description Field Using Powershell
-
Modify Local Group Using Computer Description Powershell Example
-
Create Computer Objects In Active Directory Using PowerShell
-
Update AD Computer Description With Username, Ipv4Address - Reddit
-
[SOLVED] Get Description Of Specific Computer In AD - PowerShell