Powershell – Get-azureadgroup to exclude 365 groups

#Gets all groups called GroupName

$Group= Get-AzureADGroup -SearchString "GroupName"

Uses Regex to filter out 365 groups with SPO in proxy name ( can't use -like and Where-Object as ProxyAddresses is an array  , and not contain doesn't support wildcards :( )

 $Group= $Group | ?{$_.proxyaddresses -match '.*SPO.*'}
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...