色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

更改SharePoint 的web.config設置的兩種方式

  MSDN上寫的不是很明白,自己測試通過,記錄一下:

  方法一:通過創建描述一組 Web.config 修改的 XML 文件以聲明方式注冊 Web.config 項。

  備注:

  直接寫一個webconfig.**.xml到14文件夾下的CONFIG中,在運行stsadm -o copyappbincontent 效果是一樣的;

  方法一有個缺點,會把所有WebApplication的web.Config都修改掉;

  1.在sharepoint解決方案里添加14文件夾下的CONFIG文件夾,新建webconfig.**.xml文件(本文中使用的是webconfig.rj.xml),編輯內容;

  2.修改解決方案包,如下;

  3.添加后期部署命令行,如果解決方案里沒有這一步,也可以直接在cmd中直接運行;

"C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/14/Bin/stsadm.exe" -o copyappbincontent

  方法二:使用 SharePoint Foundation 對象模型來修改 Web.config 設置

  備注:

  2011-01-06:不能在site scope feature使用的原因找到了,是因為  SPWebService.RemoteAdministratorAccessDenied默認為TRUE,將下表中的腳本保存為Set-RemoteAdministratorAccessDenied-False.ps,以管理員身份運行后IISreset,就OK了;

  參考:http://unclepaul84.blogspot.com/2010/06/sppersistedobject-xxxxxxxxxxx-could-not.html (過墻)

# AUTHOR: Paul Kotlyar

# CONTACT: unclepaul84@gmail.com

# DESCRIPTION: sets an option on content web service that allows updating of SP Administration objects such as SPJobDefinition from content web applications

function Set-RemoteAdministratorAccessDenied-False()

{

# load sharepoint api libs

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") > $null


# get content web service

$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService

# turn off remote administration security

$contentService.RemoteAdministratorAccessDenied = $false

# update the web service

$contentService.Update()



}


Set-RemoteAdministratorAccessDenied-False

NET技術更改SharePoint 的web.config設置的兩種方式,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 乌鲁木齐县| 吴川市| 枣庄市| 仙居县| 扶绥县| 洞头县| 明星| 根河市| 宣恩县| 吴忠市| 长兴县| 当阳市| 长岛县| 福州市| 抚远县| 四子王旗| 广州市| 义马市| 永新县| 黄龙县| 昌乐县| 木里| 临清市| 海口市| 延长县| 海淀区| 祁门县| 昭苏县| 新巴尔虎左旗| 平罗县| 陈巴尔虎旗| 汤原县| 青浦区| 突泉县| 海林市| 綦江县| 南开区| 新乡市| 定日县| 土默特右旗| 双牌县|