Jump to content

Change attributes AND value


VBScab
 Share

Recommended Posts

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...