Advertisement
shadmorris

Untitled

Jun 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. foreach ($group in $groups)
  2. {
  3.     $managedByArray = @()
  4.     $ownerString = $null
  5.     try
  6.     {
  7.         $managedByArray = (Get-UnifiedGroupLinks $group.alias -linktype Owner).primarysmtpaddress
  8.         foreach ($owner in $managedByArray)
  9.         {
  10.             $ownerString = $ownerString + $owner + ";"
  11.         }
  12.     }
  13.     Catch
  14.     {
  15.         $managedByArray = $null
  16.     }
  17.  
  18.     $group.Alias+","+$group.PrimarySMTPAddress+","+$group.DisplayName+","+$group.ExternalDirectoryObjectId+","+$group.WhenCreatedUTC+","+$group.ManagedBy+","+$recipientList >> GroupOutput.csv
  19.  
  20.     $x = $x + $count
  21.     ProgressBar $x $group.Alias
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement