天天看點

Powershell記錄2

powershell:

 取得sharepoint site:

 spsite=set−spsite−identityspsite=set−spsite−identityurl -sitesubscription sub−confirm:sub−confirm:false -force:ture取得urlsite:ture取得urlsite:urlsite = get-spsite|where{.url−eq.url−equrl}

 if(urlsite.sitesubscription−neurlsite.sitesubscription−nenull)

 {

 subscription=get−spsitesubscription−identitysubscription=get−spsitesubscription−identityurl

 }

設定testrunconfig.testrunconfig,把powershell放到環境變量

 # change the system powershell to the sharepoint management shell

 env:path=env:path=env:path+";c:\program files\common files\microsoft shared\web server extensions\14\config\powershell\registration\"

# start the sharepoint 2010 managment shell

 sharepoint.ps1

iis7 顯示:

 http error 403.14 – forbidden

 需要有個配置功能

 增加web.config

 <?xml version="1.0" encoding="utf-8" ?>

 <configuration>

 <system.webserver>

 <directorybrowse enabled="true"/>

 </system.webserver>

 </configuration>

xmltextreader.eof 屬性擷取一個值,該值訓示讀取器是否定位在流的結尾。

上一篇: 工作小記