Forum Discussion
O365 Global Admin has no access to recent SharePoint Online site collections
- Nov 21, 2016
You can use the below PowerShell script to get the details of the SPO Site Collections for the Office 365 Groups.
$cred=Get-Credential $exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $cred -Authentication "Basic" -AllowRedirection Import-PSSession $exchangeSession -DisableNameChecking Connect-SPOService -Url https://tenantname-admin.sharepoint.com -credential $cred $Groups=Get-UnifiedGroup |Where-Object {$_.SharePointSiteUrl -ne $null} $Groups | Foreach-Object{ $Group = $_ $GName=$Group.SharePointSiteUrl Get-SPOSite -Identity $GName -Detailed |fl }To add a member to Office 365 Groups, you can use the below one.
Add-UnifiedGroupLinks -LinkType Members -Identity "engineering" -Links "alland@XXXXX.onmicrosoft.com
I am sure that the Office 365 Group's SPO File audits are available in "Audit log search" in protection centre [https://protection.office.com/#/unifiedauditlog]. Screen-shot of the audit logs for O365 groups is posted below.
Thanks for responding guys.
But I still have the problem that I can't get the details of sites that I don't know about. And I wont know about them unless I have access. And I can't give myself (or my service account) access, unless I know about them...
Given that Get-SPOSite doesn't return all sites by default and that the Site Collection list in O365 Admin/SPO Admin doesn't display Group sites (and Video, etc). How can I reliably get a list of site collections? To which I can then add my admin group/service account to, so that I can programmaticaly access those sites going forward.
Users are still able to external share from Group sites, which means there are potentially external users with access to content that I can't audit.
There are 3rd party tools claiming to be able to audit/report/change this stuff. How are they doing it? Or are they actually trapped in the same way, with minimal, if any, visability of Group sites?
You can use the below PowerShell script to get the details of the SPO Site Collections for the Office 365 Groups.
$cred=Get-Credential
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $cred -Authentication "Basic" -AllowRedirection
Import-PSSession $exchangeSession -DisableNameChecking
Connect-SPOService -Url https://tenantname-admin.sharepoint.com -credential $cred
$Groups=Get-UnifiedGroup |Where-Object {$_.SharePointSiteUrl -ne $null}
$Groups | Foreach-Object{
$Group = $_
$GName=$Group.SharePointSiteUrl
Get-SPOSite -Identity $GName -Detailed |fl
} To add a member to Office 365 Groups, you can use the below one.
Add-UnifiedGroupLinks -LinkType Members -Identity "engineering" -Links "alland@XXXXX.onmicrosoft.com
I am sure that the Office 365 Group's SPO File audits are available in "Audit log search" in protection centre [https://protection.office.com/#/unifiedauditlog]. Screen-shot of the audit logs for O365 groups is posted below.