Windows PowerShell is a command-line shell and scripting language designed especially for system administration. The following describes accessing XIA Configuration Server from PowerShell.


If you are using two factor authentication with client certificates, please see Using Windows PowerShell with Client Certificates.



To connect PowerShell to the XIA Configuration Server, use the following in a PowerShell script or the PowerShell Integrated Scripting Environment (ISE) replacing the URL as required:


$xia = New-WebServiceProxy -UseDefaultCredential -Uri "http://localhost/xiaconfiguration/webservice/xiaconfiguration.asmx"



The following example is formatted for easy reading and displays the name of the connected user account:


# Connect to the server

Clear-Host

$url = "http://localhost/xiaconfiguration/webservice/xiaconfiguration.asmx"

Write-Host "Connecting to XIA Server at" $url

$xia = New-WebServiceProxy -UseDefaultCredential -Uri $url 

Write-Host "Connected as" $xia.WhoAmI()



To use specific credentials use the Get-Credential cmdlet.

$creds = Get-Credential 

$xia = New-WebServiceProxy -Uri $url -Credential $creds