Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. Import-Module AzureAD
  2.  
  3. Connect-AzureAD
  4.  
  5. $adGroupId = "<Azure AD Group Id here>"
  6.  
  7. $users = Get-AzureADGroupMember -ObjectId $adGroupId
  8.  
  9. foreach ($u in $users)
  10. {
  11. Write-Host $u.DisplayName
  12. Set-AzureADUser -ObjectId $u.Mail -Department "<New Value to update here>"
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement