XIA Links - Get all applications and their locations
To get all the applications that have been added to XIA Links, including their possible location paths, use the API which is accessed from the XIA Links Server homepage:
The GET_MyApplications operation returns a list of all the applications. Each application within this list contains the name and a list of possible location paths.
Here is an example PowerShell script which connects to the server, gets the applications then loops through each
application and writes out the name and possible location paths to a CSV file which is saved in c:\temp
# Connect
to the server
Clear-Host
Write-Host "Connecting
to XIA Links Server at" $url
$xia = New-WebServiceProxy -UseDefaultCredential -Uri $url
Write-Host "Connected
as" $xia.WhoAmI()
Write-Host ""
# Write
the CSV headers
$binaryData = "Application
name, Possible Application Location Paths"
# Get all
applications
Write-Host "Executing
GET_MyApplications"
$response = $xia.GET_MyApplications()
# Get data
for each application
foreach($application in $response.Applications)
{
$binaryData += "`r`n" # Put each
application on a new line
$binaryData += $application.ApplicationName
$binaryData += ","
#
Get each possible application location path
foreach($possibleApplicationPath in $application.PossibleApplicationPaths)
{
$binaryData += $possibleApplicationPath + "
"
}
}
Write-Host "Saving
CSV file"
$filename = "c:\temp\xialinksapplications.csv"
[IO.File]::WriteAllText($filename,$binaryData)
[System.Diagnostics.Process]::Start($filename)
Comments
Post a Comment