Answered by:
Add parameter in xml file through VBScript

Question
-
Below is the configuration file where i want to add some values in line number 186. This is the parameter (<Parameter name="MaxPayloadSize" value="4096"/>) which i want to update into the same xml file through VBScript
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WinCollectConfiguration version="7.2.9-96" xmlns="event_collection/WinCollect">
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectPlugin" name="LogFileReaderFactory">
<Environment>
<Parameter value="5000" name="DefaultFilePollInterval"/>
</Environment>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectCommon" name="DiskManager">
<Environment>
<Parameter value="6144" name="Capacity"/>
<Parameter value="%ALLUSERSPROFILE%\WinCollect\Data" name="BasePath"/>
</Environment>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectCommon" name="PersistenceManager">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Module" type="StageType" module="StoreAndForward" name="StoreAndForwardStage">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WindowsMessageCache" name="MessageCache">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectCommon" name="UNCMachineNameFactory">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectCommon" name="RegistryCache">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="DeviceType" module="DeviceWindowsLog" name="DeviceWindowsLog">
<Environment>
<Parameter value="60000" name="EventLogMonitor.RetryTimeoutMillis"/>
<Parameter value="AdaptiveThreadPool" name="DeviceThreadPoolType"/>
<Parameter value="1500" name="DefaultThrottleTimeout"/>
<Parameter value="5" name="MinEventMonitorThreads"/>
<Parameter value="500" name="AdaptiveThreadPool.ReaderThreadsMax"/>
<Parameter value="250" name="MaxEventMonitorThreads"/>
<Parameter value="5" name="AdaptiveThreadPool.ReaderThreadsMin"/>
<Parameter value="Seconds" name="TimestampFormat"/>
<Parameter value="200" name="AdaptiveThreadPool.ReaderBacklogSamplePeriodMillis"/>
<Parameter value="MSEVEN6" name="DefaultEventLogPollProtocol"/>
</Environment>
<InstanceData>
<Instance enabled="true" name="Servername">
<Environment>
<Parameter value="Servername" name="DeviceAddress"/>
<Parameter value="Servername" name="RemoteMachine"/>
<Parameter value="" name="Filter.ForwardedEvents.Param"/>
<Parameter value="No Filtering" name="Filter.System.Type"/>
<Parameter value="" name="CustomQuery.Base64"/>
<Parameter value="No Filtering" name="Filter.Directory Service.Type"/>
<Parameter value="true" name="EventTypeFilterError"/>
<Parameter value="" name="Filter.DNS Server.Param"/>
<Parameter value="No Filtering" name="Filter.Application.Type"/>
<Parameter value="SOURCE" name="ForwardedEvents.Identifier"/>
<Parameter value="true" name="EventTypeFilterInfo"/>
<Parameter value="false" name="Log.ForwardedEvents"/>
<Parameter value="true" name="Log.Directory Service"/>
<Parameter value="true" name="EventTypeFilterWarn"/>
<Parameter value="UDP" name="Dest.Protocol"/>
<Parameter value="" name="Filter.System.Param"/>
<Parameter value="true" name="Log.File Replication Service"/>
<Parameter value="false" name="ADLookup.Enabled"/>
<Parameter value="No Filtering" name="Filter.DNS Server.Type"/>
<Parameter value="true" name="EventTypeFilterSuccessAudit"/>
<Parameter value="" name="Filter.Application.Param"/>
<Parameter value="" name="Filter.Directory Service.Param"/>
<Parameter value="No Filtering" name="Filter.Security.Type"/>
<Parameter value="514" name="Dest.Port"/>
<Parameter value="None" name="Application"/>
<Parameter value="false" name="Filter.Directory Service.Enabled"/>
<Parameter value="MSEVEN6" name="EventLogPollProtocol"/>
<Parameter value="1000" name="ThrottleTimeout"/>
<Parameter value="Servername" name="HostID"/>
<Parameter value="true" name="Log.System"/>
<Parameter value="" name="Filter.File Replication Service.Param"/>
<Parameter value="No Filtering" name="Filter.ForwardedEvents.Type"/>
<Parameter value="false" name="Filter.ForwardedEvents.Enabled"/>
<Parameter value="true" name="Log.Security"/>
<Parameter value="true" name="Log.DNS Server"/>
<Parameter value="false" name="Filter.File Replication Service.Enabled"/>
<Parameter value="" name="ADLookup.DomainControllerName"/>
<Parameter value="" name="ADLookup.DNSDomainName"/>
<Parameter value="false" name="Filter.Application.Enabled"/>
<Parameter value="WinCollect @ Servername" name="WinCollectInstanceName"/>
<Parameter value="false" name="Filter.DNS Server.Enabled"/>
<Parameter value="true" name="EventTypeFilterFailureAudit"/>
<Parameter value="true" name="Local.System"/>
<Parameter value="true" name="Log.Application"/>
<Parameter value="false" name="Filter.Security.Enabled"/>
<Parameter value="" name="Filter.Security.Param"/>
<Parameter value="3000" name="RemoteMachinePollInterval"/>
<Parameter value="High Event Rate Server" name="EventRateTuningProfile"/>
<Parameter value="false" name="Filter.System.Enabled"/>
<Parameter value="No Filtering" name="Filter.File Replication Service.Type"/>
<Parameter value="1250" name="MinLogsToProcessPerPass"/>
<Parameter value="1875" name="MaxLogsToProcessPerPass"/>
<Parameter value="0" name="Login.Handle"/>
</Environment>
</Instance>
</InstanceData>
</Service>
<Service version="7.2.9-96" classification="Static" type="Service" module="AgentCore" name="AgentCore">
<Environment>
<Parameter value="300000" name="HeartbeatInterval"/>
<Parameter value="UDP" name="LogMonitor.Socket.Type"/>
<Parameter value="300000" name="ConfigurationCheckInterval"/>
<Parameter value="true" name="Enabled"/>
<Parameter value="false" name="Deleted"/>
</Environment>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectCommon" name="InfoRepositoryClient">
<Environment>
<Parameter value="corbaloc::127.0.0.1:12345/DCPSInfoRepo" name="DCPSInfoRepo"/>
<Parameter value="1" name="DCPSBit"/>
<Parameter value="44380" name="DomainId"/>
<Parameter value="*=127.0.0*" name="ORBPreferredInterfaces"/>
<Parameter value="0" name="DCPSDebugLevel"/>
</Environment>
</Service>
<Service version="7.2.9-96" classification="NodeService" type="Service" module="WinCollectCommon" name="InfoRepositoryServer">
<Environment>
<Parameter value="80" name="DCPSLivelinessFactor"/>
<Parameter value="0" name="DCPSBit"/>
<Parameter value="44380" name="DomainId"/>
<Parameter value="20" name="DCPSChunks"/>
<Parameter value="iiop://127.0.0.1:12345" name="ORBEndpoint"/>
<Parameter value="10" name="DCPSChunkAssociationMultiplier"/>
<Parameter value="30" name="DCPSPendingTimeout"/>
<Parameter value="0" name="DCPSDebugLevel"/>
</Environment>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="CommunicationAPI" name="ConnectionFactory">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="NodeService" type="Service" module="CommunicationAPI" name="ConnectionFactory">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="Win2K8EventLogSupport" name="Windows2008EventCollector">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Module" type="StageType" module="DestinationSyslog" name="SyslogHeaderStage">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Module" type="StageType" module="DestinationSyslog" name="UDPSendStage">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Module" type="StageType" module="DestinationFileLogger" name="LoggerStage">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Module" type="StageType" module="DestinationSyslog" name="TCPSendStage">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Module" type="StageType" module="Stream" name="SimpleEventThrottle">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectPlugin" name="DestinationManager">
<Environment/>
<InstanceData>
<Instance name="4.4.4.4">
<Environment/>
<Module order="1" service_name="StoreAndForwardStage">
<Environment>
<Parameter value="10" name="DataChunkPeriod"/>
<Parameter value="500000" name="DataProcessingPeriod"/>
<Parameter value="750000" name="QueueLowWaterMark"/>
<Parameter value="1000000" name="QueueHighWaterMark"/>
<Parameter value="true" name="Schedule.Enable"/>
<Parameter value="false" name="Schedule.Invert"/>
<Parameter value="true" name="Socket.KeepAlive.Enabled"/>
<Parameter value="30000" name="Socket.KeepAlive.Time"/>
<Parameter value="4000" name="Socket.KeepAlive.Interval"/>
</Environment>
</Module>
<Module order="2" service_name="SimpleEventThrottle">
<Environment>
<Parameter value="5000" name="EventThrottleInEPS"/>
</Environment>
</Module>
<Module order="3" service_name="SyslogHeaderStage">
<Environment/>
</Module>
<Module order="4" service_name="UDPSendStage">
<Environment>
<Parameter value="4.4.4.4" name="TargetAddress"/>
<Parameter value="514" name="TargetPort"/>
</Environment>
</Module>
</Instance>
</InstanceData>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="Routing" name="PayloadRouter">
<Environment>
<Parameter value="3" name="RouterThreads"/>
<Parameter value="10000000" name="QueueHighWaterMark"/>
<Parameter value="30" name="StatisticsSweepPeriod"/>
<Parameter value="9975000" name="QueueLowWaterMark"/>
<Parameter value="{Servername}{4.4.4.4}" name="AddRoute"/>
</Environment>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="Statistics" name="StatisticsServer">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectCommon" name="DiagnosticsEngine">
<Environment>
<Parameter value="true" name="Enabled"/>
<Parameter value="10000000" name="QueueHighWaterMark"/>
<Parameter value="9975000" name="QueueLowWaterMark"/>
</Environment>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectCommon" name="PayloadFactory">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectMonitor" name="FileMonitorFactory">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="WinCollectParser" name="ParserFactory">
<Environment/>
</Service>
<Service version="7.2.9-96" classification="Service" type="Service" module="Security" name="SecurityManager">
<InstanceData>
<Instance type="System" enabled="true" name="LOCAL SYSTEM">
<Environment>
<Parameter value="0" name="Login.Handle"/>
<Parameter value="" name="Login.Domain"/>
<Parameter value="" name="Login.Username"/>
<Parameter value="" name="Login.Password"/>
</Environment>
</Instance>
</InstanceData>
</Service>
</WinCollectConfiguration>- Edited by Deeps1234 Thursday, July 16, 2020 1:49 PM
- Moved by Drake_WuMicrosoft contingent staff Friday, July 17, 2020 5:54 AM
Thursday, July 16, 2020 1:40 PM
Answers
-
Hi,
Thanks for posting here,
This forum is for discussing the windows desktop development and it is focus on the Win32 api and C++ language, I will redirect this thread to the correct forum. Thanks for understanding.
You could ask in the following forums:
https://social.msdn.microsoft.com/Forums/en-US/home?forum=scripting
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
Best Regards,
Drake
This “General Windows Desktop Development Issues” Forum will be migrating to a new home on Microsoft Q&A, please refer to this sticky post for more details.
"Win32 API" forum will be migrating to a new home on Microsoft Q&A !
We invite you to post new questions in the "Win32 API" forum’s new home on Microsoft Q&A !
For more information, please refer to the sticky post.- Edited by Drake_WuMicrosoft contingent staff Friday, July 17, 2020 5:53 AM
- Proposed as answer by Guido Franzke Friday, July 17, 2020 6:11 AM
- Marked as answer by Dave PatrickMVP Thursday, July 23, 2020 6:44 PM
Friday, July 17, 2020 5:52 AM -
- Marked as answer by Dave PatrickMVP Thursday, July 23, 2020 6:44 PM
Friday, July 17, 2020 6:11 AM
All replies
-
Hi,
Thanks for posting here,
This forum is for discussing the windows desktop development and it is focus on the Win32 api and C++ language, I will redirect this thread to the correct forum. Thanks for understanding.
You could ask in the following forums:
https://social.msdn.microsoft.com/Forums/en-US/home?forum=scripting
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
Best Regards,
Drake
This “General Windows Desktop Development Issues” Forum will be migrating to a new home on Microsoft Q&A, please refer to this sticky post for more details.
"Win32 API" forum will be migrating to a new home on Microsoft Q&A !
We invite you to post new questions in the "Win32 API" forum’s new home on Microsoft Q&A !
For more information, please refer to the sticky post.- Edited by Drake_WuMicrosoft contingent staff Friday, July 17, 2020 5:53 AM
- Proposed as answer by Guido Franzke Friday, July 17, 2020 6:11 AM
- Marked as answer by Dave PatrickMVP Thursday, July 23, 2020 6:44 PM
Friday, July 17, 2020 5:52 AM -
- Marked as answer by Dave PatrickMVP Thursday, July 23, 2020 6:44 PM
Friday, July 17, 2020 6:11 AM