Azure AD cmdlet

From Ittichai Chammavanijakul's Wiki
Jump to navigation Jump to search
Get-AzureADUser -ObjectId "ittichai@domain.com"
Get-AzureADUser -Filter "DisplayName eq 'Jimmy Chan'"
Get-AzureADUser -Filter "DisplayName eq 'Chammavanijakul, Ittichai' and UserType eq 'Member'"

Get-AzureADUserLicenseDetail -ObjectId "ittichai@domain.com"
Get-AzureADGroup -Filter "DisplayName contains 'ZDW'"

Add-AzureADGroupMember -ObjectId "62438306-7c37-4638-a72d-0ee8d9217680" -RefObjectId "0a1068c0-dbb6-4537-9db3-b48f3e31dd76"

PS C:> Get-AzureADUser -SearchString "ittichai"|  Format-Table -Wrap -AutoSize

ObjectId                             DisplayName               UserPrincipalName  UserType
--------                             -----------               -----------------  --------
b9e64745-1b31-4e49-8f3d-7b3d02bc6468 Chammavanijakul, Ittichai ittichai@domain.com Member


PS C:> Get-AzureADGroup -Filter "DisplayName eq 'ZDW Prod Workspace'"

ObjectId                                DisplayName                             Description
--------                                -----------                             -----------
b2c48db0-2d42-4a2e-af55-9b046dc46b3c    ZDW Prod Workspace                      ZDW Prod Workspace

Get-AzureADGroupMember -ObjectId  b2c48db0-2d42-4a2e-af55-9b046dc46b3c

PS C:> Get-AzureADGroupMember -ObjectId  b2c48db0-2d42-4a2e-af55-9b046dc46b3c

ObjectId                      DisplayName                   UserPrincipalName             UserType
--------                      -----------                   -----------------             --------
b9e64745-1b31-4e49-8f3d-7b... Chammavanijakul, Ittichai     ittichai@domain.com            Member
d4018855-8b9e-431e-b7b1-fc... Doe, Joe                      JDoe@domain.com                Member


Add-AzureADGroupMember -ObjectId "b2c48db0-2d42-4a2e-af55-9b046dc46b3c" -RefObjectId "1c7bb767-738c-4bbc-8d14-31cbfdf6e97b"

Remove-AzureADGroupMember -ObjectId "b2c48db0-2d42-4a2e-af55-9b046dc46b3c" -MemberId "1c7bb767-738c-4bbc-8d14-31cbfdf6e97b"