SharePoint Online 子网站在 WebsCount 参数中列出 0
SharePoint Online Subsites listing 0 in WebsCount parameter
我正在使用以下连接到我的 SPO 租户并提取报告,但是我发现 WebsCount 参数没有填充任何子站点,有没有人遇到过类似的行为以及如何修复此批量查询?
Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking
#Config Parameters
$AdminSiteURL="https://SPTenant-admin.sharepoint.com"
$ReportOutput="C:\Temp\SPOStorage.csv"
#Get Credentials to connect to SharePoint Admin Center
$Cred = Get-Credential
#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL –Credential $Cred
#Get all Site collections details and Export to CSV
Get-SPOSite -Limit ALL -Detailed | Export-Csv -Path $ReportOutput -NoTypeInformation
以下PowerShell供您参考。
Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking
#Config Parameters
$AdminSiteURL="https://tenant-admin.sharepoint.com"
$ReportOutput="C:\Temp\SPOStorage.csv"
#Get Credentials to connect to SharePoint Admin Center
$Cred = Get-Credential
#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL –Credential $Cred
#Get All site collections
$SiteCollections = Get-SPOSite -Limit All
Write-Host "Total Number of Site collections Found:"$SiteCollections.count -f Yellow
#Array to store Result
$ResultSet = @()
#Loop through each site collection and retrieve details
Foreach ($Site in $SiteCollections)
{
Write-Host "Processing Site Collection :"$Site.URL -f Yellow
$Site=Get-SPOSite -identity $Site.Url -Limit ALL -Detailed
#Get site collection details
$Result = new-object PSObject
$Result | add-member -membertype NoteProperty -name "Title" -Value $Site.Title
$Result | add-member -membertype NoteProperty -name "Url" -Value $Site.Url
$Result | add-member -membertype NoteProperty -name "WebsCount" -Value $Site.WebsCount
$Result | add-member -membertype NoteProperty -name "LastContentModifiedDate" -Value $Site.LastContentModifiedDate
$Result | add-member -membertype NoteProperty -name "Status" -Value $Site.Status
$Result | add-member -membertype NoteProperty -name "LocaleId" -Value $Site.LocaleId
$Result | add-member -membertype NoteProperty -name "LockState" -Value $Site.LockState
$Result | add-member -membertype NoteProperty -name "StorageQuota" -Value $Site.StorageQuota
$Result | add-member -membertype NoteProperty -name "StorageQuotaWarningLevel" -Value $Site.StorageQuotaWarningLevel
$Result | add-member -membertype NoteProperty -name "Used" -Value $Site.StorageUsageCurrent
$Result | add-member -membertype NoteProperty -name "CompatibilityLevel" -Value $Site.CompatibilityLevel
$Result | add-member -membertype NoteProperty -name "Template" -Value $Site.Template
$Result | add-member -membertype NoteProperty -name "SharingCapability" -Value $Site.SharingCapability
$ResultSet += $Result
}
#Export Result to csv file
$ResultSet | Export-Csv $ReportOutput -notypeinformation
Write-Host "Site Quota Report Generated Successfully!" -f Green
在此处查看类似的线程:SiteProperties.WebsCount property is returning zero (CSOM)?
我正在使用以下连接到我的 SPO 租户并提取报告,但是我发现 WebsCount 参数没有填充任何子站点,有没有人遇到过类似的行为以及如何修复此批量查询?
Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking
#Config Parameters
$AdminSiteURL="https://SPTenant-admin.sharepoint.com"
$ReportOutput="C:\Temp\SPOStorage.csv"
#Get Credentials to connect to SharePoint Admin Center
$Cred = Get-Credential
#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL –Credential $Cred
#Get all Site collections details and Export to CSV
Get-SPOSite -Limit ALL -Detailed | Export-Csv -Path $ReportOutput -NoTypeInformation
以下PowerShell供您参考。
Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking
#Config Parameters
$AdminSiteURL="https://tenant-admin.sharepoint.com"
$ReportOutput="C:\Temp\SPOStorage.csv"
#Get Credentials to connect to SharePoint Admin Center
$Cred = Get-Credential
#Connect to SharePoint Online Admin Center
Connect-SPOService -Url $AdminSiteURL –Credential $Cred
#Get All site collections
$SiteCollections = Get-SPOSite -Limit All
Write-Host "Total Number of Site collections Found:"$SiteCollections.count -f Yellow
#Array to store Result
$ResultSet = @()
#Loop through each site collection and retrieve details
Foreach ($Site in $SiteCollections)
{
Write-Host "Processing Site Collection :"$Site.URL -f Yellow
$Site=Get-SPOSite -identity $Site.Url -Limit ALL -Detailed
#Get site collection details
$Result = new-object PSObject
$Result | add-member -membertype NoteProperty -name "Title" -Value $Site.Title
$Result | add-member -membertype NoteProperty -name "Url" -Value $Site.Url
$Result | add-member -membertype NoteProperty -name "WebsCount" -Value $Site.WebsCount
$Result | add-member -membertype NoteProperty -name "LastContentModifiedDate" -Value $Site.LastContentModifiedDate
$Result | add-member -membertype NoteProperty -name "Status" -Value $Site.Status
$Result | add-member -membertype NoteProperty -name "LocaleId" -Value $Site.LocaleId
$Result | add-member -membertype NoteProperty -name "LockState" -Value $Site.LockState
$Result | add-member -membertype NoteProperty -name "StorageQuota" -Value $Site.StorageQuota
$Result | add-member -membertype NoteProperty -name "StorageQuotaWarningLevel" -Value $Site.StorageQuotaWarningLevel
$Result | add-member -membertype NoteProperty -name "Used" -Value $Site.StorageUsageCurrent
$Result | add-member -membertype NoteProperty -name "CompatibilityLevel" -Value $Site.CompatibilityLevel
$Result | add-member -membertype NoteProperty -name "Template" -Value $Site.Template
$Result | add-member -membertype NoteProperty -name "SharingCapability" -Value $Site.SharingCapability
$ResultSet += $Result
}
#Export Result to csv file
$ResultSet | Export-Csv $ReportOutput -notypeinformation
Write-Host "Site Quota Report Generated Successfully!" -f Green
在此处查看类似的线程:SiteProperties.WebsCount property is returning zero (CSOM)?