Get SharePoint Online site info to CSV report using PowerShell

 

Here is a simple script to get storage info from all sites on your SharePoint Online tenant, exported to a CSV file so that you can analyze it in Excel or Power BI. All it takes is modifying the SPAdminURL variable, log in and then run this script:

$SPAdminURL = "https://contoso-admin.sharepoint.com"
Connect-SPOService -Url $SPAdminURL
$siteInfo = Get-SPOSite -Limit ALL |Select Url, Title, GroupId, LastContentModifiedDate, Status, @{N='StorageUsageGB';E={$_.StorageUsageCurrent/1024}}, IsTeamsConnected, Owner
$siteInfo | Export-Csv -Path C:\temp\SPOSiteInfo.csv -NoTypeInformation 


If you want to add more properties, here is a list of items that you can add to the Select statement:

LastContentModifiedDate
Status
ResourceUsageCurrent
ResourceUsageAverage
StorageUsageCurrent
LockIssue
WebsCount
CompatibilityLevel
DisableSharingForNonOwnersStatus
HubSiteId
IsHubSite
RelatedGroupId
GroupId
Url
LocaleId
LockState
Owner
StorageQuota
StorageQuotaWarningLevel
ResourceQuota
ResourceQuotaWarningLevel
Template
Title
AllowSelfServiceUpgrade
DenyAddAndCustomizePages
PWAEnabled
SharingCapability
SiteDefinedSharingCapability
SandboxedCodeActivationCapability
DisableCompanyWideSharingLinks
DisableAppViews
DisableFlows
AuthenticationContextName
StorageQuotaType
RestrictedToGeo
ShowPeoplePickerSuggestionsForGuestUsers
SharingDomainRestrictionMode
SharingAllowedDomainList
SharingBlockedDomainList
ConditionalAccessPolicy
AllowDownloadingNonWebViewableFiles
LimitedAccessFileType
AllowEditing
SensitivityLabel
CommentsOnSitePagesDisabled
SocialBarOnSitePagesDisabled
DefaultSharingLinkType
DefaultLinkPermission
DefaultLinkToExistingAccess
AnonymousLinkExpirationInDays
OverrideTenantAnonymousLinkExpirationPolicy
ExternalUserExpirationInDays
OverrideTenantExternalUserExpirationPolicy
SharingLockDownEnabled
SharingLockDownCanBeCleared
InformationSegment
InformationBarriersMode
BlockDownloadLinksFileType
OverrideBlockUserInfoVisibility
IsTeamsConnected
IsTeamsChannelConnected
TeamsChannelType
MediaTranscription
ExcludedBlockDownloadGroupIds
ExcludeBlockDownloadPolicySiteOwners
BlockDownloadPolicy
LoopSharingCapability
LoopOverrideSharingCapability
LoopDefaultSharingLinkScope
LoopDefaultSharingLinkRole
RequestFilesLinkEnabled
RequestFilesLinkExpirationInDays
OverrideSharingCapability
DefaultShareLinkScope
DefaultShareLinkRole
ReadOnlyForUnmanagedDevices
RestrictedAccessControl

Resources:
Share on Google Plus

About Tom DeMeulenaere

Highly accomplished information technology professional with extensive knowledge in System Center Configuration Manager, Windows Server, SharePoint, and Office 365.
    Blogger Comment

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.