Jun 03 2021 02:30 AM
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
eption
+ 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
Jun 03 2021 06:02 PM
Jun 07 2021 04:09 AM
Jun 07 2021 05:41 PM
Jun 10 2021 12:52 AM
Jun 10 2021 01:03 AM
Jun 10 2021 01:16 AM - edited Jun 10 2021 01:18 AM
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.
Jun 10 2021 05:23 AM
I can access the Admin center via browser and I have temporarily disabled the windows firewall.
This is the error:
Jun 10 2021 05:32 AM
Solution
try these commands,
Invoke-WebRequest "https://localhost:6516"
Export-Connection "https://localhost:6516" -fileName "WAC-connections.csv"
Jun 10 2021 06:55 AM