色尼玛亚洲综合影院,亚洲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設置的兩種方式,轉載需保留來源!

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

主站蜘蛛池模板: 肇东市| 禹州市| 克什克腾旗| 扎鲁特旗| 霞浦县| 当阳市| 金溪县| 桂平市| 高淳县| 六枝特区| 彝良县| 海淀区| 宾阳县| 宝坻区| 施甸县| 台湾省| 远安县| 临朐县| 密云县| 工布江达县| 西充县| 芜湖市| 江山市| 新闻| 大姚县| 定结县| 宁化县| 台北市| 留坝县| 峡江县| 锡林浩特市| 江西省| 兴仁县| 原阳县| 仲巴县| 定西市| 海南省| 泉州市| 兴文县| 定南县| 海阳市|