Here is the PowerShell script:
$cfgProperty = "MaxInstances"
$newVal = 50
$folder = "C:\Program Files\ArcGIS\Server10.0\server\user\cfg"
$files = Get-childItem –filter *.cfg -path $folder -recurse
foreach($file in $files)
{
$xmldata = [xml](Get-Content $file.fullname)
$node = $xmldata.SelectSingleNode("ServerObjectConfiguration/" + $cfgProperty)
if($node -ne $null) { $node.set_InnerText($newVal) }
$xmldata.Save($file.FullName)
}
All you need to do is change the first three lines for your system. Set as follows.
- $cfgProperty – Set this to the exact configuration name that you want to change. This is case sensitive. I recommend opening one of your cfg files and doing a Copy/Paste.
- $newVal – Set this to whatever you want the value for the target property to be.
- $folder – Set this to the location of your .cfg files.
I just modify the script and copy and paste it into the Windows PowerShell command prompt. Once you execute the code just restart the SOM service (ArcGIS Server Object Manager) and all your settings will be applied.
Hey Linux people. Feel free to add your own script to do this as a comment!
Excellent and time saving....
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteyou’ve made some good points there. it’s a good idea! Please visit http://goo.gl/NeNtws
ReplyDelete