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()
}
}

SharePoint2013 Powershell script to get site Title, Site Owner, Site user count and usage的更多相关文章

  1. SharePoint 2013 How to Backup Site Collection Automatically With a PowerShell Script

    In this post I will introduce a way how to run a script for backing up SharePoint data which could b ...

  2. Send email alert from Performance Monitor using PowerShell script (检测windows服务器的cpu 硬盘 服务等性能,发email的方法) -摘自网络

    I have created an alert in Performance Monitor (Windows Server 2008 R2) that should be triggered whe ...

  3. 微软 PowerShell Script Explorer

    微软 PowerShell Script Explorer 满血复活,正式发布 一年前的今天,微软在其Windows PowerShell官方博客声明中止 ‘Script Explorer’ 应用程序 ...

  4. Powershell script to install Windows Updates (msu) from folder

    ######################################################### # # Name: InstallWindowsUpdates.ps1 # Auth ...

  5. Join to domain powershell script

    Join to domain powershell script $username = "domain\admin" $Password = "xxxxxxxx&quo ...

  6. How can I add a site title refiner

    一篇非常好的博客,收藏一下 https://sharepoint.stackexchange.com/questions/109409/how-can-i-add-a-site-title-refin ...

  7. Healwire Online Pharmacy 3.0 Cross Site Request Forgery / Cross Site Scripting

    Healwire Online Pharmacy version 3.0 suffers from cross site request forgery and cross site scriptin ...

  8. Windows Azure Web Site (8) 设置Web Site时区

    <Windows Azure Platform 系列文章目录> 许多已经使用Azure Web Site的用户已经发现了,Azure Web Site默认的系统时间是UTC时区. 比如我们 ...

  9. Windows Azure Web Site (12) Azure Web Site配置文件

    <Windows Azure Platform 系列文章目录>  本文将介绍如何在Azure Web Site里配置连接字符串. 本文分为以下几个步骤: 1.在本地ASP.NET项目使用W ...

随机推荐

  1. android 回车键事件编程

    实现android按下回车键便隐藏输入键盘,有两种方法: 1.)如果布局是多个EditText,为每个EditText控件设置android:singleLine=”true”,弹出的软盘输入法中回车 ...

  2. C语言--函数

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvenVveW91MTMxNA==/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...

  3. 理解ArcGIS Javascript Viewer Widget及编程模型

    一个ArcGIS Javascript Viewer for JavaScript Widget是一组可以共享.迁移及部署到JavaScript View程序中的的文本文件.通常,一个程序员如果要开发 ...

  4. spring beans源码解读之--BeanFactory进化史

    BeanFactory是访问bean容器的根接口,它是一个bean容器的基本客户端视图. 先让我们看看beanfactory的前生后世吧! beanFactory有四个重要的子接口: SimpleJn ...

  5. 关于struts2中action请求会执行两次的问题

    关于struts2中action请求会执行两次的问题     在struts2中发现,调用action中的方法,方法会被执行两次,后来发现调用的方法是get开头的,把它改为其他名称开头的后,就不会执行 ...

  6. RHEL7安装配置TigerVNC

    TigerVNC使用非加密的链接,默认会被firewalld blocked 掉,想要 vnc正常工作就需要让firewalld开放相应的端口才行. vnc默认的端口号为5900,而每个vnc win ...

  7. node基础再现--module.exports 和exports

    实际上,最最基础的方法,最最原始的方法是module.exports,至于exports,是为了方便书写才出来的,应该说,module.exports 包含exports,所工作的范围更加的广泛! m ...

  8. You must not call setTag() on a view Glide is targeting

    概述 在使用Glide加载图片时,如果出现"You must not call setTag() on a view Glide is targeting"的错误,八成是在使用Li ...

  9. ORACLE每组只保留一条记录

    删除同一组内其他记录 DELETE from memactivities a where exists(select 1 FROM (select Uuid,ci_no,lst_upd_ts,ROW_ ...

  10. windows Server 2008 -必须使用“角色管理工具”安装或配置Microsoft .Net Framework 3.5

    在windows Server 2008上安装 .Net Framework 3.5的时候,报错:必须使用“角色管理工具”安装或配置Microsoft .Net Framework 3.5. Solu ...