zoukankan      html  css  js  c++  java
  • SharePoint2013 Powershell script to get site Title, Site Owner, Site user count and usage

    Powershell script to get site Title, Site Owner, Site user count and usage

    Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
    $wburl = Read-Host "Enter Web application URL "
    $webApp = Get-SPWebApplication $wburl
    $outputPath =Read-Host "Enter path to save results "
    Add-Content -Path $outputPath -Value "Site Title,Site URL, Site Owner, UserCount,Usage in MB"
    foreach ($SiteCollection in $webApp.Sites)
    {
    $url = $SiteCollection.Url
    $webs = Get-SPWeb $URL
    [boolean] $WriteToFile = $true
    $weburl = $SiteCollection.OpenWeb()
    $siteowner = ""
    foreach ($siteAdmin in $weburl.SiteAdministrators)
    {
    $siteowner = $siteAdmin.LoginName + "|" + $siteowner
    }
    foreach($web in $webs)
    {
    #Grab all users in the site collections
    $siteUserCnt = $web.AllUsers.Count
    $Siteurl = $web.Url
    $siteTitle = $web.Title
    $site = Get-SPSite  $Siteurl
    
    $siteusage = $site.Usage.Storage/1MB
    
    Add-Content -Path $outputPath -Value "$siteTitle,$Siteurl,$siteowner,$siteUserCnt,$siteusage"
    $web.Dispose()
    }
    }
  • 相关阅读:
    hadoop
    spark
    docfetcher
    redis参考资料
    Redis系列-存储篇sorted set主要操作函数小结
    predis操作大全
    composer安装使用
    寒假作业2
    寒假作业随笔
    面向对象寒假作业编程题
  • 原文地址:https://www.cnblogs.com/csts/p/3819271.html
Copyright © 2011-2022 走看看