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

更改SharePoint 的web.config設(shè)置的兩種方式

  MSDN上寫的不是很明白,自己測(cè)試通過(guò),記錄一下:

  方法一:通過(guò)創(chuàng)建描述一組 Web.config 修改的 XML 文件以聲明方式注冊(cè) Web.config 項(xiàng)。

  備注:

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

  方法一有個(gè)缺點(diǎn),會(huì)把所有WebApplication的web.Config都修改掉;

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

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

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

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

  方法二:使用 SharePoint Foundation 對(duì)象模型來(lái)修改 Web.config 設(shè)置

  備注:

  2011-01-06:不能在site scope feature使用的原因找到了,是因?yàn)椤 PWebService.RemoteAdministratorAccessDenied默認(rèn)為TRUE,將下表中的腳本保存為Set-RemoteAdministratorAccessDenied-False.ps,以管理員身份運(yùn)行后IISreset,就OK了;

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

# 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技術(shù)更改SharePoint 的web.config設(shè)置的兩種方式,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 广宗县| 广平县| 泰和县| 四会市| 永仁县| 云林县| 临泉县| 井陉县| 余江县| 东辽县| 碌曲县| 德令哈市| 凤山县| 安溪县| 石景山区| 洪湖市| 漠河县| 湖南省| 靖宇县| 勐海县| 卓资县| 封丘县| 正宁县| 朝阳区| 太仆寺旗| 新昌县| 阿荣旗| 西和县| 将乐县| 阳原县| 太保市| 内江市| 沙坪坝区| 玉树县| 河池市| 子洲县| 花莲市| 奉化市| 东台市| 玉林市| 雅安市|