Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Import-Module AzureAD
- Connect-AzureAD
- $adGroupId = "<Azure AD Group Id here>"
- $users = Get-AzureADGroupMember -ObjectId $adGroupId
- foreach ($u in $users)
- {
- Write-Host $u.DisplayName
- Set-AzureADUser -ObjectId $u.Mail -Department "<New Value to update here>"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement