Does the ActiveDirectory module for Windows Server 2022 PowerShell use Microsoft Graph?

Frederico Nunes 21 Reputation points
2022-03-14T13:20:56.097+00:00

Hello,

I am trying to figure out what is the best way to get a list of Azure Active Directory AD users/groups from Powershell.

I've found three different ways to do it:

  1. Get-ADGroup: this cmdlet is part of the "Active Directory module for Windows PowerShell", for "Windows Server 2022 PowerShell". Link here.
  2. Get-AzureADGroup: this cmdlet is part of the "Azure Active Directory PowerShell for Graph" module. This is a module for the "Azure Active Directory Powershell 2.0". Link here.
  3. Get-MgGroup: this cmdlet is part of the "Microsoft.Graph.Groups module, for the "Microsoft Graph PowerShell v1.0". Link here.

Option 1: is the option used on my script; however, I can't understand if this module is using "Azure AD graph" (which apparently is being deprecated) or if it's using Microsoft Graph.
Option 2: I am fairly sure is using Active Directory graph, which is being deprecated.
Option 3: no idea if I should be using this.

Any insights would be greatly appreciated.
Thank you.

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.8K Reputation points MVP Volunteer Moderator
    2022-03-14T14:06:25.65+00:00

    Option #1 is for on-premises AD, not Azure AD. It will help you get details on any groups that are being synchronized to Azure AD, however it cannot help you with cloud-authored groups. It doesn't use either the old Azure AD Graph nor the Microsoft Graph.
    If your goal is to manage Azure AD objects via PowerShell, use option #3.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.