WAC 2103 Export-Connection gives error


I get an error when trying to export my server list connections - any ideas?

I have a lot of servers entered - I would feel a lot more comfortable with a backup of them...

PS C:\Users\grma> Import-Module "$env:ProgramFiles\windows admin center\PowerShell\Modules\ConnectionTools"
PS C:\Users\grma> Export-Connection "https://localhost" -fileName "WAC-connections.csv"
Invoke-WebRequest : Unable to connect to the remote server
At C:\Program Files\windows admin center\PowerShell\Modules\ConnectionTools\ConnectionTools.psm1:75 char:17
+     $response = Invoke-WebRequest @params
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Failed to get the connections
At C:\Program Files\windows admin center\PowerShell\Modules\ConnectionTools\ConnectionTools.psm1:77 char:9
+         throw "Failed to get the connections"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Failed to get the connections:String) [], RuntimeException
    + FullyQualifiedErrorId : Failed to get the connections
11 Replies
I can export connection,
if you use WAC version 2103, please update to version 2103.2 and try again.
I have just updated to 2103.2 and still get the same issue.

Is it because I am not using a FQDN like in the example - my host connects using https://localhost in a browser?

try this command,


Export-Connection "https://localhost" -Credential $(Get-Credential)

@Jim Lin


Still does not work (using either user or admin PS session):





try this command

Invoke-WebRequest "https://localhost" -Verbose



if the response code does not equal 200, it will response "Failed to get the connections" to you,

so, please run "Invoke-WebRequest "https://localhost" -Verbose" to get http response code.

@Jim Lin 


I can access the Admin center via browser and I have temporarily disabled the windows firewall.

This is the error:




best response confirmed by garymansell (Contributor)



try these commands,


Invoke-WebRequest "https://localhost:6516"

Export-Connection "https://localhost:6516" -fileName "WAC-connections.csv"



Perfect - putting the port number fixed it, thanks so much for your help.