Poweshell Export-Connection gives error using WAC 2103

Copper Contributor

It seems that the powershell cmdlets for exporting / importing connections are no longer working in WAC 2103


Steps to re-produce the issue open powershell then run the following commands



Import-Module "$env:ProgramFiles\windows admin center\PowerShell\Modules\ConnectionTools"
Export-Connection https://$env:computername
Invoke-WebRequest : The remote server returned an error: (500) Internal Server Error.
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




On checking the module versions it seems that the ConnectionTools module is now listed as version 0.0 vs 0.1 in 2009



PS C:\temp> get-module -name ConnectionTools

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.0        ConnectionTools                     {Export-Connection, Import-Connection}




On trying to do an import with the new module 



PS C:\temp> Import-Connection https://$env:computername -fileName .\WACReset.txt
ConvertFrom-Json : Invalid JSON primitive: The.
At C:\Program Files\windows admin center\PowerShell\Modules\ConnectionTools\ConnectionTools.psm1:206 char:18
+         $error = ConvertFrom-Json $_
+                  ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand



It will then list out the servers that should have been added but dosnt apply them.


This happened on a 2009 -> 2103 upgrade and also on a fresh install on a windows 10 Sandbox Machine.


Windows Admin Center

9 Replies

I am having the same issue, The import looks like it is working but nothing shows up under connections and I get the same error message trying to export.


@Davey Rance 


Having the same issue
best response confirmed by Davey Rance (Copper Contributor)
So the response that i have had from Microsoft as i opened a ticket is that it is confirmed that it is an issue and will be addressed in a future build. Currently the only option if you want to use powershell for doing imports is going back to previous build. (2009)
Another thing is that also the Feed-Cmdlets are not working anymore...

Is it possible to add this to the case you opened, too???

I was able to Get- Remove- and Add-Feed with v2009 but not with 2103...
Hi, any solution on this issue - I'm encountering this fault also
As Dave mentioned above, this seems a known issue at Microsoft and will be solved in the next release.
For me it would be not a nice to have, but an urgent issue, because I install WAC on several servers and sync feed, extensions, etc., so I don't have to do it all from scratch and by hand.
That's why I would treat with more importance and not wait to "a future build"

Maybe in the future Microsoft will handle such PS things for WAC more important
Roll back to 2009. Still waiting for new released build to address issues.

This was published yesterday and one of the bug fixes lists.

PowerShell commands fixed
In the v2103 release, many users were unable to utilize PowerShell to manage their Windows Admin Center settings and connections. In this release, you should be able to effectively use these commands to configure your Windows Admin Center gateway.

@Davey Rance 


yes the Add-wacconnection is working with the new release,


however the remove-wacconnection is not - it seems to try to add something instead which gets denied.

I'll try to debug it somemore.