H
Highlander
Hello all.
The following lines are an excerpt from a machine.config file:
<configuration>
<system.net>
<connectionManagement>
<add address="*" maxconnection="10"/>
</connectionManagement>
</system.net>
<system.web>
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="machine"
password="AutoGenerate"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="100"
maxIoThreads="100"
minWorkerThreads="50"
/>
</system.web>
</configuration>
I'm using the following VBScript to edit the machine.config file and
change the "maxconnection" value from 10 to 48:
Dim strServer, XMLFilePath, XMLFileName, XMLFile, XMLFileBak
strServer = "000-WEB15-CRS"
XMLFilePath = "\\" & strServer & _
"\C$\Winnt\Microsoft.NET\Framework\v1.1.4322\CONFIG\"
XMLFileName = "machine.config"
XMLFile = XMLFilePath & XMLFileName
XMLFileBak = XMLFileName & "_Backup_" & ".txt"
Set xmlDoc = CreateObject("Msxml.DOMDocument")
xmlDoc.async = False
xmlDoc.PreserveWhitespace = True
xmlDoc.load XMLFile
'~~~ Create backup of original XML file
Set objFSO = CreateObject("Scripting.FileSystemObject")
CreateObject("Scripting.FilesystemObject") _
.GetFile(XMLFile).Name = XMLFileBak
Dim strNode, strKeyName, strNewValue
strNode = "/*/*/*/*[@address=" & Chr(34) & "*" & Chr(34) & "]"
strKeyName = "maxconnection"
strNewValue = "48"
Set objNode = xmlDoc.selectSingleNode (strNode)
objNode.setAttribute strKeyName, strNewValue
xmlDoc.Save XMLFile
Set xmlDoc = nothing
Set objFSO = nothing
Set objNode = nothing
The script works fine, except for one thing. The whitespace appears to
be preserved throughout the machine.config file - except for the
"<processModel" section. This section gets changed - the entire section
ends up on one horizontal line:
<processModel enable="true" timeout="Infinite"
idleTimeout="Infinite" shutdownTimeout="0:00:05"
requestLimit="Infinite" requestQueueLimit="5000" restartQueueLimit="10"
memoryLimit="60" webGarden="false" cpuMask="0xffffffff"
userName="machine" password="AutoGenerate" logLevel="Errors"
clientConnectedCheck="0:00:05" comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate" responseDeadlockInterval="00:03:00"
maxWorkerThreads="100" maxIoThreads="100" minWorkerThreads="50"/>
Any idea what's causing this? Any help would be greatly appreciated.
Thanks!
- Dave
The following lines are an excerpt from a machine.config file:
<configuration>
<system.net>
<connectionManagement>
<add address="*" maxconnection="10"/>
</connectionManagement>
</system.net>
<system.web>
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="machine"
password="AutoGenerate"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="100"
maxIoThreads="100"
minWorkerThreads="50"
/>
</system.web>
</configuration>
I'm using the following VBScript to edit the machine.config file and
change the "maxconnection" value from 10 to 48:
Dim strServer, XMLFilePath, XMLFileName, XMLFile, XMLFileBak
strServer = "000-WEB15-CRS"
XMLFilePath = "\\" & strServer & _
"\C$\Winnt\Microsoft.NET\Framework\v1.1.4322\CONFIG\"
XMLFileName = "machine.config"
XMLFile = XMLFilePath & XMLFileName
XMLFileBak = XMLFileName & "_Backup_" & ".txt"
Set xmlDoc = CreateObject("Msxml.DOMDocument")
xmlDoc.async = False
xmlDoc.PreserveWhitespace = True
xmlDoc.load XMLFile
'~~~ Create backup of original XML file
Set objFSO = CreateObject("Scripting.FileSystemObject")
CreateObject("Scripting.FilesystemObject") _
.GetFile(XMLFile).Name = XMLFileBak
Dim strNode, strKeyName, strNewValue
strNode = "/*/*/*/*[@address=" & Chr(34) & "*" & Chr(34) & "]"
strKeyName = "maxconnection"
strNewValue = "48"
Set objNode = xmlDoc.selectSingleNode (strNode)
objNode.setAttribute strKeyName, strNewValue
xmlDoc.Save XMLFile
Set xmlDoc = nothing
Set objFSO = nothing
Set objNode = nothing
The script works fine, except for one thing. The whitespace appears to
be preserved throughout the machine.config file - except for the
"<processModel" section. This section gets changed - the entire section
ends up on one horizontal line:
<processModel enable="true" timeout="Infinite"
idleTimeout="Infinite" shutdownTimeout="0:00:05"
requestLimit="Infinite" requestQueueLimit="5000" restartQueueLimit="10"
memoryLimit="60" webGarden="false" cpuMask="0xffffffff"
userName="machine" password="AutoGenerate" logLevel="Errors"
clientConnectedCheck="0:00:05" comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate" responseDeadlockInterval="00:03:00"
maxWorkerThreads="100" maxIoThreads="100" minWorkerThreads="50"/>
Any idea what's causing this? Any help would be greatly appreciated.
Thanks!
- Dave