随笔分类 - 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...
阅读全文
摘要:cls [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") foreach ($webApplication in Get-SPWebApplication) { Write-Host Write-Host "Processing $webApplicati...
阅读全文
摘要:cls [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") foreach ($webApplication in Get-SPWebApplication) { Write-Host ...
阅读全文
摘要:clsif ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell"}$...
阅读全文
摘要:批量导入站点权限cls$Web = Get-SPWeb "http://16.178.115.14:91/"Get-Content c:\export\account.txt | ForEach-Object { Write-Host $_ $account = $web.Ensur...
阅读全文
摘要: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/
阅读全文
摘要:clsAdd-PSSnapin Microsoft.SharePoint.PowerShell -ea 0$site = New-Object Microsoft.SharePoint.SPSite("http://sitecollection")$webs = $site.AllWebs## ex...
阅读全文
摘要:cls $PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null $webAppUrl = Read-Host $WebApp = Get-SPWebApplication $webAppUrl Foreach ($SiteColl in ...
阅读全文
摘要: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...
阅读全文
摘要:clear $PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null$webAppUrl = Read-Host$WebApp = Get-SPWebApplication $webAppUrlForeach ($SiteColl in $WebApp.S...
阅读全文
摘要: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...
阅读全文
摘要:当我运行下面的 powershell 脚本时: $FarmAcct = 'domain\user' $secPassword = ConvertTo-SecureString 'aaa' -AsPlaintext -Force $global:farmCredential_ = New-Object System.Management.Automation.PsCredential $Fa...
阅读全文
摘要:$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
阅读全文
摘要: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
阅读全文
摘要: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 |
阅读全文
摘要:owa安装完后,在sharepoint网站上打开word,excel,报错,Sorry, something went wrong, 通过correlation id找到错误信息(如何在sharepoint里通过correlation id查找详细的错误信息): Area : SharePoint FoundationCategory : WOPILevel : Unexpe...
阅读全文
摘要:########################################################### 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
阅读全文