I was wondering if someone could help me/my client?
I have managed to pull from XML into a List box all the ComputerID from an XML file (example below) using
PowerShell Code
Double-click the code block to select all.[xml]$xmlfile = Get-Content "\\server\share$\xmlfile.xml $Computer = $xmlfile.Computers.Computer Load-ListBox -ListBox $listbox1 -Items $($Computer.ComputerID)
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<Computers>
<Computer>
<UserID>gsmith</UserID>
<ComputerID>GLOS-01</ComputerID>
<ComputerIP>192.168.2.145</ComputerIP>
<ComputerLastLogon>28-07-2015-10:08</ComputerLastLogon>
<ComputerUpdateLevel>2</ComputerUpdateLevel>
</Computer>
<Computer>
<UserID>tdailey</UserID>
<ComputerID>BRIS-01451</ComputerID>
<ComputerIP>192.168.1.86</ComputerIP>
<ComputerLastLogon>16-08-2015-22:36</ComputerLastLogon>
<ComputerUpdateLevel>1</ComputerUpdateLevel>
</Computer>
...
</Computers>
I have tried using ....SelectedItem.... but no good!
There are a number of other bits that will be done but I cant figure how to pull <UserID>
XML above is a basic (with additional information removed) XML file that will have additional information added as and when the info is updated (XML created by other app).
Thanks in advance