0%
Listing and Retrieving Information

Listing and Retrieving Information

This guide shows you how to list and retrieve user information in Active Directory with PowerShell.

10-15 min

Guide to Listing and Retrieving User Account Information in Active Directory with PowerShell

This guide explains how to use PowerShell to list user accounts in Active Directory (AD) and retrieve specific information about those accounts. The commands presented here let you search for users with various filters and get detailed properties for user management and auditing in AD.


Commands for Listing and Retrieving User Information

1. Retrieve a Specific User by Name

To get the basic information for a specific user, use the following command:

# Retrieves the information for the user named "Administrateur"
Get-ADUser -Filter "Name -eq 'Administrateur'"
  • Purpose: Search for a specific user by name in Active Directory.
  • Explanation:
    • Get-ADUser: Cmdlet that retrieves user information from AD.
    • -Filter "Name -eq 'Administrateur'": Filter that searches for a user with the exact name "Administrateur".

2. Retrieve All Properties of a User

To get all available information about a specific user, including custom and hidden attributes, use -Properties *.

Link copied!