Alle SharePoint Site Properties mit PowerShell exportieren

Eine SharePoint Site hat im Moment 69 Properties. Möchte jemand für alle Sites die Properties exportieren sind es nur wenige PowerShell Commands.

In den Properties einer SharePoint Sites sind Konfigurationen über Gastzugriffe, Standard für Teilen, Status von Power Automate Workflows, wie lange ein anonymer Link gültig ist, und viele Informationen mehr inkludiert. Wird die Standardkonfiguration aus dem Tenant übernommen ist die Information ebenfalls inkludiert. Je nach Property in unterschiedlicher Form. In Summe sind es zum aktuellen Zeitpunkt 69 Properties. In manchen Situationen kann eine Überprüfung der Konfigurationen von Vorteil sein.

SharePoint Site Properties

Die Properties aller SharePoint Sites lassen sich über PowerShell sehr schnell auswerten und exportieren. Excel ermöglicht die Filterung und Weiterverarbeitung des Exports.

Beispielauszug über 6 Properties
  • Für dein Konto muss die Rolle SharePoint Admin aktiv sein.
  • Du benötigst das SharePoint Online PowerShell Modul.
  • Der Export wird unter C:\Users\<Username>\Documents abgelegt.

Update vom 3. Mai 2022:
Aktualisierung aufgrund von „-Limit All“ Limitierungen.

PowerShell
# Export all SharePoint site properties for SharePoint sites
# For my post at https://blog.topedia.com/?p=17391

# Replace the SharePointAdminUrl with your SharePoint Admin Center URL
$SharePointAdminUrl = "https://<Tenantname>-admin.sharepoint.com"

# SharePoint Online PowerShell module is required > https://www.powershellgallery.com/packages/Microsoft.Online.SharePoint.PowerShell
Import-Module Microsoft.Online.SharePoint.PowerShell

# Logon with a SharePoint Online Admin
Connect-SPOService $SharePointAdminUrl

$AllSPOSites = (Get-SPOSite -Limit All).Url
$PropertyExport = @()
$Count = 1
foreach ($SPOSite in $AllSPOSites) 
{
    Write-Host ("$Count of " + $AllSPOSites.Count + " - " + $SPOSite)
    
    # Requesting the site details again, due to the "-Limit All" limitations https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/get-sposite?view=sharepoint-ps#description
    $SPOSite = Get-SPOSite -Identity $SPOSite -Detailed 
    $PropertyExport += $SPOSite | select *    
    $Count++    
}

# Export the information into a csv-file at C:\Users\<Username>\Documents
$Date = get-date -format "dd-MM-yyyy"
$ExportPath = ([Environment]::GetFolderPath("MyDocuments") +  "\SharePointSitePropertiesExport-$Date.csv") 
$PropertyExport | Export-Csv -Path $ExportPath  -NoTypeInformation -Force
Write-Host "File export: $ExportPath"
Share this post:

About the Author

Tobias Asböck

Tobias Asböck

Tobias is a Senior System Engineer with more than 10 years of professional experience with Microsoft 365 products such as SharePoint Online, OneDrive for Business, Teams Collaboration, Entra ID, Information Protection, Universal Print, and Microsoft 365 Licensing. He also has 15+ years of experience planning, administering, and operating SharePoint Server environments. In his spare time, Tobias is busy with updates in the Microsoft 365 world or on the road with his road bike and other sports activities. If you have additional questions, please contact me via LinkedIn or support@topedia.com.

No comments yet