XML - change attribute AND value

admin

Administrator
Staff member
have inherited a VB Script driven by an XML file. The XML file is in a format which the developers refuse to change so I'm stuck with it. A fragment of the file looks like this:

<configuration>
<NTCredential ID="BTS_IHOST_GROUP" DisplayName="BizTalk Isolated Host Users Group" Description="Windows group for accounts with access to the Isolated BizTalk hosts">
<NTAccount ScopeType="105" UpLevelFlags="132" DownLevelFlags="2147483654">thedomain\domainuseraccountname
</NTAccount>
</NTCredential>
<more, unrelated elements, etc>
</configuration>

There are a dozen or so 'NTCredential' elements whose 'ID' attribute is unique.

I need to modify the script so that it finds a particular 'NTCredential' element, then changes the ScopeType, UpLevelFlags and DownLevelFlags attributes AND the value 'thedomain\domainuseraccountname'.

I *think* I need to use the "getElementsByTagName" method but am a complete newbie with XML. If someone can help me out with some snytax, that'd be great: as long as I can get one to work, I can handle passing in an array to a function which I will build around that syntax (I already have a WSC for updating single fields).

I'm using CreateObject("Microsoft.XMLDOM") as my XML handler.
 
Back
Top