随笔分类 -  Power Shell

摘要:1. 设置iis pool: cls Import-Module WebAdministration Get-ChildItem IIS:\apppools | ForEach-Object{ $name = $_.name Write-Host $_.name $pool = Get-Item IIS:\App... 阅读全文
posted @ 2014-07-16 10:53 疯吻IT 阅读(1355) 评论(0) 推荐(0) 编辑
摘要:cls [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") foreach ($webApplication in Get-SPWebApplication) { Write-Host Write-Host "Processing $webApplicati... 阅读全文
posted @ 2014-07-02 13:40 疯吻IT 阅读(253) 评论(0) 推荐(0) 编辑
摘要:cls [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") foreach ($webApplication in Get-SPWebApplication) { Write-Host ... 阅读全文
posted @ 2014-07-01 17:55 疯吻IT 阅读(382) 评论(0) 推荐(0) 编辑
摘要:clsif ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell"}$... 阅读全文
posted @ 2014-05-27 16:51 疯吻IT 阅读(363) 评论(0) 推荐(0) 编辑
摘要:批量导入站点权限cls$Web = Get-SPWeb "http://16.178.115.14:91/"Get-Content c:\export\account.txt | ForEach-Object { Write-Host $_ $account = $web.Ensur... 阅读全文
posted @ 2014-05-14 15:21 疯吻IT 阅读(405) 评论(0) 推荐(0) 编辑
摘要:http://gallery.technet.microsoft.com/office/Change-upload-file-limit-89502ff2 http://sharepointrelated.com/2012/07/30/maximum-file-size-per-extension-in-sharepoint-2013/ 阅读全文
posted @ 2014-05-06 11:20 疯吻IT 阅读(182) 评论(0) 推荐(0) 编辑
摘要:clsAdd-PSSnapin Microsoft.SharePoint.PowerShell -ea 0$site = New-Object Microsoft.SharePoint.SPSite("http://sitecollection")$webs = $site.AllWebs## ex... 阅读全文
posted @ 2014-04-24 15:31 疯吻IT 阅读(541) 评论(0) 推荐(0) 编辑
摘要:cls $PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null $webAppUrl = Read-Host $WebApp = Get-SPWebApplication $webAppUrl Foreach ($SiteColl in ... 阅读全文
posted @ 2014-04-22 14:19 疯吻IT 阅读(548) 评论(0) 推荐(0) 编辑
摘要:cls$featureID = (Get-SPFeature | ?{ ($_.DisplayName -eq "SiteNotebook") -and ( $_.Scope -eq "Web")}).id$sites = Get-SPSite foreach($Site in $sites){ $webs = $Site.AllWebs foreach($Web in $web... 阅读全文
posted @ 2014-04-17 11:36 疯吻IT 阅读(224) 评论(0) 推荐(0) 编辑
摘要:clear $PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null$webAppUrl = Read-Host$WebApp = Get-SPWebApplication $webAppUrlForeach ($SiteColl in $WebApp.S... 阅读全文
posted @ 2014-04-17 11:11 疯吻IT 阅读(331) 评论(0) 推荐(0) 编辑
摘要:cls$featureid = 'a7a2793e-67cd-4dc1-9fd0-43f61581207a'$webapps = Get-spWebApplicationforeach($webapp in $webapps) { foreach($site in $webapp.Sites) { foreach($webapp in $site.AllWebs) { Disable-SPFeature –identity $featureid -Confirm:$false -U... 阅读全文
posted @ 2014-03-21 15:39 疯吻IT 阅读(336) 评论(0) 推荐(0) 编辑
摘要:当我运行下面的 powershell 脚本时: $FarmAcct = 'domain\user' $secPassword = ConvertTo-SecureString 'aaa' -AsPlaintext -Force $global:farmCredential_ = New-Object System.Management.Automation.PsCredential $Fa... 阅读全文
posted @ 2014-03-18 09:19 疯吻IT 阅读(2419) 评论(0) 推荐(1) 编辑
摘要:$KBID = "KB958488" $KBID1 = "KB976902"clsfunction Remove-Update {$HotFixes = Get-HotFix[int]$count = 0;foreach ($HotFix in $HotFixes) { $count = $count + 1 Write-Host $count / $HotFixes.Count if (($KBID -ne $HotFix.HotfixId) -and ($KBID1 -ne $HotFix.HotfixId)) { "Inside firs 阅读全文
posted @ 2014-02-28 15:57 疯吻IT 阅读(5666) 评论(0) 推荐(0) 编辑
摘要:1. Delete a site collection· Run command : Remove-SPSite –Identity http://ent132.sharepoint.hp.com/teams/monitor/ –GradualDelete –Confirm:$False· In CACentral Administration->Application Management ->Delete a Site collectionChange the site collectionClick ok ,then delete.· In SQ 阅读全文
posted @ 2014-02-28 09:20 疯吻IT 阅读(4609) 评论(0) 推荐(0) 编辑
摘要:Sharepoint里我们经常遇到这样的错误信息:我们能通过下面的power shell 命令来查到详细的错误信息:cls$correlationid = read-host$date = (Get-Date).AddHours(-1)get-splogevent -StartTime $date | where-object {$_.Correlation -eq $correlationid.Trim() -and $_.Level -eq "Unexpected" } | select Area, Category, Level, EventID, Message | 阅读全文
posted @ 2014-01-27 17:56 疯吻IT 阅读(468) 评论(0) 推荐(0) 编辑
摘要:owa安装完后,在sharepoint网站上打开word,excel,报错,Sorry, something went wrong, 通过correlation id找到错误信息(如何在sharepoint里通过correlation id查找详细的错误信息): Area : SharePoint FoundationCategory : WOPILevel : Unexpe... 阅读全文
posted @ 2014-01-27 12:16 疯吻IT 阅读(2048) 评论(0) 推荐(0) 编辑
摘要:########################################################### Name: InstallWindowsUpdates.ps1# Author: Tony Murray# Version: 1.0# Date: 16/11/2010# Comment: PowerShell script to install # Windows Update files########################################################### Specify the location of the *.msu 阅读全文
posted @ 2013-12-10 22:38 疯吻IT 阅读(838) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示