Il faut maintenant fournir les informations d’usage des Office Groups, c’est ce que fait ce script.
[string]$ReportPath = ".\Reports\"
[string]$username = "Admin@yourtenant.onmicrosoft.com"[string]$PwdTXTPath = "C:\SECUREDPWD\ExportedPWD-$($username).txt"
$secureStringPwd = ConvertTo-SecureString -string (Get-Content $PwdTXTPath)
$adminCreds = New-Object System.Management.Automation.PSCredential $username, $secureStringPwd
$UserCredential = $adminCreds#$userCredential = Get-Credential
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $session$AllExistingGroups = Get-UnifiedGroup -IncludeAllProperties | Select ExternalDirectoryObjectId,Id,ServerName,Name,DisplayName,Alias,EmailAddresses,PrimarySmtpAddress,SharePointSiteUrl,Notes,Language, ManagedBy,ManagedByDetails,AccessType,GroupType,AutoSubscribeNewMembers,GroupMemberCount,GroupExternalMemberCount,WhenCreatedUTC,WhenChangedUTC
$datestring = (get-date).ToString("yyyyMMdd-hhmm")
$fileName = Join-Path -Path $ReportPath -ChildPath $("O365-Groups_"+ $datestring + ".csv")Write-host " -----------------------------------------" -ForegroundColor Green
Write-Host (" >>> writing to file {0}" -f $fileName) -ForegroundColor Green
$AllExistingGroups | Export-csv $fileName -NoTypeInformation
Write-host " -----------------------------------------" -ForegroundColor Green
Vous pouvez adapter et utiliser ce script selon vos propres besoins.
Romelard Fabrice
Version Anglaise:
Sources utilisées:
Commentaires
Enregistrer un commentaire