After releasing my Powershell Module ExportImportRdsDeployment here, which helps you to migrate your RDS deployment to a newer version, I got some great feedback from users. So it was time to implement some feature requests and improve some things from the first version. The ExportImportRdsDeployment module has been updated and it has Backup functionalities now…
Updating the Module
The module is again available in the Powershell Gallery, so you can easily install and use it on any Windows Server. Make sure you download and use version 2.0.
To check your current version:
Get-Module -ListAvailable ExportImportRdsDeployment
If you already have version 1.0 or 1.1, I would suggest you uninstall these versions, and install the latest. To do this, you simply execute this commands:
Uninstall-Module ExportImportRdsDeployment -Force Install-Module -Name ExportImportRdsDeployment -Force Get-Module -ListAvailable ExportImportRdsDeployment
Now you can import the module again and start using the updated cmdlets
I improved the instructions and help you get when using the Get-Help cmdlet. You get more information and updated examples for all 4 cmdlets in the module.
Get-Help Export-RDCollectionsFromConnectionBroker -Detailed
Optional removal of collections & servers from deployment
In the previous version, when you executed the Export-cmdlets, the collections & the servers were removed from the deployment.
In the new version, you can export the collections or export the servers using the Export-cmdlets, without the removal functionality. This way,
- You can test the export and validate the migration before performing the actual migration.
- You can use the module to create daily backups of your deployment/collections and quickly restore in case of issues or wrong manipulations on your deployment.
This is how you do it:
The Export-cmdlets are in Export-Only mode by default. So if you run the cmdlet as you did before, no removal will be performed at the end of the export.
Export-RDCollectionsFromConnectionBroker -ConnectionBroker localhost Export-RDDeploymentFromConnectionBroker -ConnectionBroker localhost
You can specifically declare this too, to make sure no removal is executed, using the RemoveCollections & RemoveServers switch-parameters:
Export-RDCollectionsFromConnectionBroker -ConnectionBroker localhost -RemoveCollections:$false -Verbose Export-RDDeploymentFromConnectionBroker -ConnectionBroker localhost -RemoveServers:$false -Verbose
If you want to perform the migration, you must specify the -RemoveCollections or -RemoveServers parameter and confirm the export with removal. With this safety feature, you cannot mistakenly remove anything.
Reboot Pending check when importing
When running the Import-RDDeploymentToConnectionBroker cmdlet, the module will check if there is a Reboot pending on the target machines (in the export XML file). If there are reboots pending, you can let the cmdlet try to reboot the VMs, or do it manually. You cannot continue with the import until the servers are rebooted.
File access test for XML file
Before performing an export, the cmdlet will test if you have permissions and access to the XMLFile location you have specified (or to the default location). If you do not have access, the cmdlet will stop the export.
Export before removing
When performing an export with -RemoveCollections or -RemoveServers parameter, the cmdlet will first perform the export to the XMLfile before removing the collection/deployment. The writing to the XMLfile must succeed first before continuing.
[Microsoft.RemoteDesktopServices.Management.RDSessionCollectionType] on a Windows 2012 machine
On a Windows 2012 machine, the cmdlet will correctly check for the [Microsoft.RemoteDesktopServices.Management.RDSessionCollectionType] when exporting/importing.
With this update to the module, you should be able to migrate your entire deployment more easily than before, again on any platform (like Azure) and faster than performing an in-place upgrade.
If you have any questions or feature requests, do not hesitate to contact me using the comments, or via Twitter/LinkedIn.
|David||August 12, 2019 at 8:23 pm|
Hi – wondering if these pw modules would work for migrating 2016 to 2019 RDS?
August 12, 2019 at 7:29 pm
|Claud||January 9, 2020 at 7:26 pm|
Hi Micha, in the import asks to restart servers but when giving “yes” a message appears and stops. Although I restart the servers manually it does not detect the restart in the powershell. ExportImportRdsDeployment 2.0
January 9, 2020 at 9:48 pm
|Maciej||January 29, 2020 at 11:30 am|
Hallo Micha, i need to migrate broker with 140 host servers, however it stuck on checking pending reboots on servers, any idea why? I have waited like a 2 hours but no result.
March 17, 2020 at 5:30 pm