之前一篇文章《两张图看清SharePoint 2013 Farm 逻辑体系结构》谈到Web Application,Content Database,Site Collection的关系。有了这个逻辑结构图之后,这篇文章将使用PowerShell,来更加直观的展现SharePoint WebApplication的体系结构。

SharePoint WebApplication Structure

  • 从上图可以看出,一个WebApplication可以包含多个Content Database,可以使用PowerShell查看WebApplication包含的Content Databases。
Add-PSSnapin Microsoft.SharePoint.PowerShell

#Get-SPWebApplication |Get-Member#

Get-SPWebApplication  | %{

    Write-Host "`n -$($_.Url)";
foreach($cd in $_.ContentDatabases){
Write-Host "$($cd.Name)"
}
}
  • 当然也可以获取更精确的数据,比如Content Database的Size
Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPWebApplication | %{Write-Output "`n -$($_.Url)";foreach($cd in $_.ContentDatabases){
$ContentDatabaseSize = [Math]::Round(($cd.disksizerequired/1GB),2)
Write-Output "ContentName:$($cd.Name) `n Size:$($ContentDatabaseSize)G"
}}
  • 得到了Content Database之后,还可以继续深究,如得到Content Database中包含的Site Collection,同样可以一行PoweShell获取。
Add-PSSnapin Microsoft.SharePoint.PowerShell

#Get-SPContentDatabase |Get-Member#

Get-SPContentDatabase | %{Write-Output "`n -$($_.Name)";foreach($site in $_.Sites){Write-Output "$($site.Url)"}}   >>c:\xx2.txt
  • 当然还可以得到Site Collection的Size,方法同得到Content Database的Size一样,同样也是一行PowerShell实现。
Add-PSSnapin Microsoft.SharePoint.PowerShell

Get-SPWebApplication |%{Write-Output "`n -$($_.Url)";$_.Sites | select url, @{label="Size in MB";Expression={[Math]::Round($_.usage.storage/1MB,2)}}|Sort-Object -Descending -Property "Size in MB"}>>c:\tt.txt

利用 PowerShell 分析SharePoint WebApplication 体系结构的更多相关文章

  1. SharePoint自动化部署,利用PowerShell 导入用户至AD——PART II

    这是对上一篇文章<SharePoint自动化部署,利用PowerShell 导出/导入AD中的用户>进行补充.开发时,为了测试和演示,我们往往需要经常性的把用户添加到AD中.数据量小的时候 ...

  2. SharePoint自动化部署,利用PowerShell 导出/导入AD中的用户

    这几个月一直在帮客户改需求,部署.我已经心力憔悴,经过一段时间的摸索,我对用PowerShell实现自动化部署也有了一些心得,比如说利用PowerShell导出导入AD中的User.在基于ShareP ...

  3. 利用powershell进行windows日志分析

    0x00 前言 Windows 中提供了 2 个分析事件日志的 PowerShell cmdlet:一个是Get-WinEvent,超级强大,但使用起来比较麻烦:另一个是Get-EventLog,使得 ...

  4. powershell 操作sharepoint命令集

    打开SharePoint 2013 Management Shell, and then run as administrator.执行如下命令 1. 添加wsp和安装Add-SPSolution - ...

  5. 利用Powershell查询AD中账号属性

    标签:AD账号信息 最后登录时间 最后修改密码.SID 账号SID 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://hubuxcg ...

  6. 使用PowerShell 创建SharePoint 站点

    使用PowerShell 创建SharePoint 站点         在SharePoint开发中,你应该学会使用PowerShell管理SharePoint网站.SharePoint Manag ...

  7. 利用Powershell和ceye.io实现Windows账户密码回传

    利用Powershell和ceye.io实现Windows账户密码回传 转自:http://www.freebuf.com/articles/system/129068.html 最近在研究Power ...

  8. 利用PowerShell+Jenkins,实现项目的自动化部署

    当项目越来越庞大,部署环境越来越多以后,就会越来越依赖于自动化.比如本人公司的项目,目前有6个web和4个windows service,同时本地有两套环境:开发自测试环境和QA测试环境.每次版本发布 ...

  9. Office 365 - Windows PowerShell for SharePoint Online

    Office 365 PowerShell for SharePoint Online 1. Get-SPOTenantLogEntry 并不能获取所有的Log信息,只能用于获取因外部资源而出错的lo ...

随机推荐

  1. jQuery 用each后添加click

    mydd = $('.plist'); mydd.each(function(i){ $(this).click(function(){ mydl.eq(i).hide("slow" ...

  2. 是否缺少对 Microsoft.CSharp.dll 和 System.Core.dll 的引用?

    错误提示 : 预定义的类型“Microsoft.CSharp.RuntimeBinder.Binder”未定义或未导入 是否缺少对 Microsoft.CSharp.dll 和 System.Core ...

  3. Lintcode: Add Binary

    C++ class Solution { public: /** * @param a a number * @param b a number * @return the result */ str ...

  4. 微软BI 之SSRS 系列 - 如何实现报表导航 Navigation 和钻取 Drill Down 的效果

    开篇介绍 如何在 SSRS 报表中实现标签导航 Navigation 和向下钻取 Drill Down的效果? 如同下面这个例子一样 - 在页面第一次加载的时候,默认显示是全部地区的销售总和情况,上面 ...

  5. MDX Step by Step 读书笔记(八) - Navigating Hierarchies 层次结构导航

    开篇介绍 本章主要内容包括: 解释各种不同的 MDX 导航函数的使用: Parent, Children, FirstChild, LastChild, Siblings, FirstSibling, ...

  6. postman发送get请求

    在地址栏里输入请求url(用到拼接方式):http://127.0.0.1:8081/getuser?userid=1 选择“GET”方式, 点击“send”得到json数据如图   分类: post ...

  7. linux find command information more

    查找文件find ./ -type f 查找目录find ./ -type d 查找名字为test的文件或目录find ./ -name test 查找名字符合正则表达式的文件,注意前面的‘.*’(查 ...

  8. Centos 6下安装Oracle 11gR2

    一.安装环境 CentOS release 6.7 (Final) Oracle Database 11g Release 2 二.安装前准备 #修改主机名 修改/etc/sysconfig/netw ...

  9. 表访问方式---->全表扫描(Full Table Scans, FTS)

    全表扫描(Full Table Scans, FTS) 全表扫描是指Oracle在访问目标表里的数据时,会从该表所占用的第一个区(EXTENT)的第一个块(BLOCK)开始扫描,一直扫描到该表的高水位 ...

  10. Sakila——MySQL样例数据库解析(已经迁移)

    一.Introduction Sakila可以作为数据库设计的参考,也可作为实验数据.我是用作数据仓库和ODI学习的实验数据. The Sakila sample database was devel ...