Hello,
reference documentation for cmdlet mapping between modules:
MS Graph API for the Azure AD PowerShell replacement cmdlets ?
Hi Everyone,
I wonder what's the equivalent Microsoft Graph for the below function or cmdlet?
Since the Azure AD PowerShell Module is about to be deprecated based on https://learn.microsoft.com/en-us/powershell/module/azuread/?view=azureadps-2.0
Connect-AzureAD -TenantId 2e89c6df-50b5-44ce-a2c2-7f65f1916583
Get-AzureADUser -SearchString 'First.LastName@Domain.com' | Get-AzureADUserMembership | Format-List
Remove-AzureADGroupMember -ObjectId f4c2fd92-4b6a-4035-b940-ec58acf3d87f -MemberId e1364883-edc6-4369-92ea-618cd2ed9e6d
Remove-AzureADDirectoryRoleMember -ObjectId f4c2fd92-4b6a-4035-b940-ec58acf3d87f -MemberId 16997715-54b6-45fd-84e8-e1c58c6dbaf5
Revoke-AzureADUserAllRefreshToken -ObjectId f4c2fd92-4b6a-4035-b940-ec58acf3d87f
Disconnect-AzureAD
Any help is greatly appreciated.
Thanks.
-
Rafael da Rocha 5,076 Reputation points
2022-08-01T13:13:06.297+00:00
2 additional answers
Sort by: Most helpful
-
ShivaniRai-MSFT 2,726 Reputation points
2022-08-01T13:18:23.523+00:00 Hi @EnterpriseArchitect ,
You can find equivalent Microsoft Graph PowerShell SDK in this documentation.
Reference docs:
https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.users/get-mgusermemberof?view=graph-powershell-1.0&preserve-view=trueHope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.
-
Limitless Technology 39,376 Reputation points
2022-08-02T07:36:50.837+00:00 Hi there,
Scripts written in Azure AD PowerShell won't automatically work with Microsoft Graph PowerShell. The new cmdlet names have been designed to be easy to learn. Instead of using AzureAD or AzureADMS in cmdlet names, use Mg. For example, the old cmdlet Get-AzureADUser has become Get-MgUser. However, migration is more than just becoming familiar with the new cmdlet names. There are renamed modules, parameters, and other important changes.
Migrate from Azure AD PowerShell to the Microsoft Graph PowerShell SDK
Azure AD to Microsoft Graph migration changes in Azure PowerShell
https://learn.microsoft.com/en-us/powershell/azure/azps-msgraph-migration-changes?view=azps-8.1.0
-----------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer–