Home > Mobile >  What are the replacement for Remove-AzureAD* cmdlets?
What are the replacement for Remove-AzureAD* cmdlets?

Time:08-02

Since the Azure AD PowerShell Module is about to be deprecated based on https://docs.microsoft.com/en-us/powershell/module/azuread/?view=azureadps-2.0

I wonder what's the equivalent Microsoft Graph for the below function or cmdlet ?

Connect-AzureAD -TenantId 318430f4-12d8-459b-a27c-d6100bbf42a2

Get-AzureADUser -SearchString '[email protected]' | Get-AzureADUserMembership | Format-List

$ObjectID = '02152b14-6baa-4cd1-9085-b7c890230652'

$paramRemoveAzureADGroupMember = @{
    ObjectId = $ObjectID
    MemberId = 'e789eaca-87ba-406c-9590-f1c565c95639'
}

$paramRemoveAzureADDirectoryRoleMember = @{
    ObjectId = $ObjectID
    MemberId = '02e84104-6e54-452c-8f2c-9cf81fe867c6'
}

$paramRevokeAzureADUserAllRefreshToken = @{
    ObjectId = $ObjectID
    Verbose  = $true
}
Remove-AzureADGroupMember @paramRemoveAzureADGroupMember
Remove-AzureADDirectoryRoleMember @paramRemoveAzureADDirectoryRoleMember
Revoke-AzureADUserAllRefreshToken @paramRevokeAzureADUserAllRefreshToken

Disconnect-AzureAD

CodePudding user response:

You can see the new cmdlet mappings here

Find Azure AD and MSOnline cmdlets in Microsoft Graph PowerShell

  • Related