Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix script to pull proper EXO module #3

Merged
merged 1 commit into from
Jul 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Office 365/PS_Get_O365_Group_Members.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
############################################################################################################################################
############################################################################################################################################
# Script that allows to get the members for each Office 365 Group defined in an Office 365 tenant.
# Required Parameters: N/A.
############################################################################################################################################
Expand All @@ -19,8 +19,7 @@ function Get-O365Members
foreach ($O365Group in $O365Groups)
{
Write-Host "Members of Group: " $O365Group.DisplayName -ForegroundColor Green
Get-UnifiedGroupLinks –Identity $O365Group.Identity –LinkType Members
Write-Host
Get-UnifiedGroupLinks –Identity $O365Group.Identity –LinkType Members | Select-Object -Property DisplayName, PrimarySmtpAddress
}
}
catch [System.Exception]
Expand All @@ -34,8 +33,8 @@ $sUserName="<Your_Office365_Admin_Account>"
$sMessage="Introduce your Office 365 Credentials"
#Connection to Office 365
$msolCred = Get-Credential -UserName $sUserName -Message $sMessage
Connect-MsolService -credential $msolCred
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $msolCred -Authentication Basic -AllowRedirection
Import-PSSession $Session -AllowClobber

#Getting Groups Information
Get-O365Members