Hi Everyone,
I have a list of users (about 150)that are in a security group, for each of the users I need to list what other security/office 365/mail enabled groups they belong to. I’ve been using msonline powershell v1 and being a complete novice have been looking at various online forums but cannot figure out how to pull the information out, what I've got so far is:
$GroupMembers = Get-MsolGroupMember -GroupObjectId (%Group ID%)
foreach ($GroupMember in $GroupMembers)
{
$Properties = @{"GroupDisplayName"=$Group_DisplayName;
"MemberDisplayName"=$GroupMember.DisplayName;
"MemberEmail"=$GroupMember.EmailAddress;
"MemberType"=$GroupMember.GroupMemberType}
$Obj = New-Object -TypeName PSObject -Property $Properties
Write-Output $Obj | select GroupDisplayName,MemberDisplayName,MemberEmail,MemberType }
I'm not sure what command I would use to pull the users other security group membership out, any advice would be a great help.
Cheers