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

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

时间: 2024-11-10 07:42:40

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

Use powershell script against password hacking over OWA

In my previous company Exchange OWA isn't published to internet, so this blog described my first time encountering hacker trying to hack my new company's Active directory passwords. Based on it, I wrote a powershell script running on each CAS servers

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 whenever \Processor(_Total)\% Processor Time is Above 10 (a small value just to guarantee that the condition for sending the alert is always met). You ca

Add Users to a Group using PowerShell Script

Script: #Add Users to a Group - PowerShell Script Import-module ActiveDirectory Import-CSV "C:\Scripts\Users.csv" | % { Add-ADGroupMember -Identity TestGroup1 -Member $_.UserName } 原文地址:http://blog.51cto.com/549687/2120182

sharepoint 站点 site actions 下只有 site settings 选项

如题,原因是在CA--Site Collection Quotas and Locks 中lock了该站点为:Read-only (blocks additions, updates, and deletions) 修改为Not locked ,问题解决.

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

<Windows Azure Platform 系列文章目录> 许多已经使用Azure Web Site的用户已经发现了,Azure Web Site默认的系统时间是UTC时区. 比如我们在本地使用Visual Studio 2013创建Web Site项目,在Default.aspx.cs输入以下代码: Label1.Text = DateTime.Now.ToString(); 编译通过后,在本地调试显示的是本地系统时间. 而我们部署到Azure Web Site之后,显示的是UTC时区.

Windows Azure Web Site (14) Azure Web Site IP白名单

<Windows Azure Platform 系列文章目录> 我们知道,在Azure Cloud Service和Virtual Machine,可以通过Endpoint ACL (Access Control List)访问控制列表.来设置IP白名单规则. 具体请参考:Windows Azure Virtual Network (10) 使用Azure Access Control List(ACL)设置客户端访问权限 在默认情况下,Azure Web Site是没有IP白名单的.也就是说

PowerShell Script Analyzer, Script browser 和 Pester

昨天在MVA上看PowerShell5的最新功能的合集视频,第一个演讲人是微软PowerShell 开发组的经理,他提到了DevOp 的发展趋势,他认为对于PowerShell而言,除了基本的PowerShell的技能,还需要掌握以下基本的技能和工具: PowerShell DSC 版本控制 Git & Github 脚本最佳优化 Script Analyzer 单元测试 Pester PowerShell DSC和Github 豆子倒是用过,后面两个是什么呢? 首先看看Script Analy

Enable PowerShell script execution policy

Open     Windows PowerShell with administrator Run "Set-ExecutionPolicy     UnRestricted –Force"

利用powershell script每个月定期从microsoft download网站上抓补丁

This artical will be published in English also: http://www.cnblogs.com/LarryAtCNBlog/p/4026695.html 本人所在的公司对于安全性要求较高,除了平时各种内网加密外网firewall之外,对于server所使用的OS也要求更新到最新的security级别的补丁. 但是样本数量一多就总有些是打不上补丁的,这可能由于各种各样如update配置错误,SCCM/WSUS抽风,加上第3方扫描补丁软件的2X机制和se