Home » PowerShell » Get AdUser Description From Active Directory

Get AdUser Description From Active Directory

Use the Get-AdUser cmdlet in PowerShell to get aduser description from the active directory. AdUser object has property Description, using Select or Select-Object we can get aduser description.

In this article, we will discuss how to get aduser description from the active directory using the Get-AdUser cmdlet.

Get AdUser Description

To get aduser description from the active directory using PowerShell script, use the Get-AdUser cmdlet.

Get-ADUser -Identity Dev.NewHouse -Properties Description | Select-Object -ExpandProperty Description

In the above PowerShell script, the Get-AdUser cmdlet uses the Identity parameter to specify the aduser and uses the Properties parameter to select Description and pipes the aduser object to the Select-Object cmdlet.

The Select-Object uses the ExpandProperty parameter to specify a property to select, in our case it is aduser Description.

The output of the above PowerShell script to get aduser description as EU-DEVOPS

PS C:\> Get-ADUser -Identity Dev.NewHouse -Properties Description | Select-Object -ExpandProperty Description
EU-DEVOPS

PS C:\>

If you don’t have the aduser Description set, it will return the aduser description as empty or blank.

You can refer to the below code as well to get aduser description using the Get-AdUser cmdlet.

Get-ADUser -Identity Dev.NewHouse -Properties Description | Select Description

In the above PowerShell script, the Get-Aduser cmdlet uses the Identity parameter to specify the aduser to get a description and pipes the aduser object to the Select cmdlet.

The Select command uses the Description property to get aduser description.

The output of the above PowerShell script to retrieve aduser description from the active directory is:

Get AdUser Description
Get AdUser Description

Conclusion

I hope the above article on how to get aduser description using the Get-AdUser cmdlet is helpful to you.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.

Leave a Comment