Would you like to learn how to query the user information from Active Directory using Powershell? In this tutorial, we are going to show you how to use Powershell to get information from Active Directory accounts using the command-line on a computer running Windows.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Related tutorial - PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell - Get user information from Active Directory

As an Administrator, start a new POWERSHELL command-line prompt.

Windows 10 - powershell elevated

Get all domain users from Active Directory.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get all properties from all user accounts.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get all users from a specific organizational unit.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get the name and username from all accounts.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get the list of disabled user accounts.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get the list of locked user accounts.

Copy to Clipboard

Get the last logon from all user accounts.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get the last logon and status from all user accounts.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Get all users with a specific text in the name.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You are able to get user-related information from Active Directory using Powershell.