I'm creating a script on creating and validating virtual directories in IIS.
In an attempt to keep the script generic so it can be run on different computers and scenarios, I've hit a wall: I cannot find the "LOCAL COMPUTER" node in IIS without hardcoding the computer name, which will be problematic on other computers.
Have considered using key sequences, but unfortunately the node is not always in the same position. :(
Could get it working briefly by modifying the control path's line in the Repository.cs file as follows (C#):
Code: Select all
[language=csharp] _treeitemComputerName = new RepoItemInfo(this, "treeItemComputerName", "container/form/element/tree/treeitem/treeitem[@text>'" + System.Environment.MachineName + "']", 30000, null, "0f696513-a295-414b-b381-0592758cb3ca"); [/language]
Snapshot of the control and other information for what it's worth:
- OS: Win7 / SP1 / Server 2008
- IIS: IIS 7.5 / IIS 7 / IIS 6.0
- RANOREX: 184.108.40.20618
:?: What I need is a way to pull system information, such as the computer name, directly into my control path.
Any help would be appreciated.