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.
Does the ActiveDirectory module for Windows Server 2022 PowerShell use Microsoft Graph?
Frederico Nunes
21
Reputation points
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:
- Get-ADGroup: this cmdlet is part of the "Active Directory module for Windows PowerShell", for "Windows Server 2022 PowerShell". Link here.
- 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.
- 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
8,329 questions
Microsoft Security | Microsoft Entra | Microsoft Entra ID
25,180 questions
Accepted answer
-
Vasil Michev 119.8K Reputation points MVP Volunteer Moderator
2022-03-14T14:06:25.65+00:00