HOWTO: Automate the creation of Citrix PVS boot devices (ISO/VMDK)

Recently, I was working for a customer to automate the deployment of a Citrix Provisioning Services environment (PVS). The customer didn’t want to use the PXE and TFTP method for booting the target devices to PVS. Instead, the customer chose to use the CD-ROM (ISO) boot method for their target devices.

Because I wanted to automate the complete environment, including the creation of the ISO files, I was having a challenge. Searching the internet didn’t give me any results. Therefore, I gave it a last try by searching the PVS program folder. What I found there was really interesting. I came across this file called NewBootDeviceManager.dll-Help.xml.

filenewbootdevicemanagerdllhelp

I opened this file in Notepad and found the following content.

contentnewbootdevicemanagerdllhelp

Now it got interesting. This might just be the thing I needed. But how to use it?

Reading a bit further in the NewBootDeviceManager.dll-Help.xml file, I found this is actually a proper PowerShell snap-in. Simply a registration of a DLL file, adding the snap-in in PowerShell, and Bob’s your uncle.

installutilbdmpowershellsdkdll

The _NewBootDeviceManager.dll-Help.xml _file also gives some examples for creating different boot devices, like ISO files and boot partitions (VMDK).

Step 1 – Start the PowerShell Console in Administrator mode

So, let’s put this into action by starting the PowerShell console in Administrator mode. This is required, because we are going to install the BdmPowerShellSdk.dll file.

Step 2 – Install the DLL

posh_installutilbdmpowershellsdkdll

Execute the following command:

Remember to change the path to installutil.exe for x86 environments.

Make sure the DLL is installed properly by looking for two lines that say “The Commit phase completed successfully.” and “The transacted install has completed.“.

posh_installutilbdmpowershellsdkdllsuccess

Step 3 – Add the snap-in

posh_addpssnapinbdmpssnapin

Execute the following command:

Step 4 – Execute the (example) code

Execute the following commands:

This example adds two PVS login servers, uses DHCP and outputs this to an ISO file C:test.iso.

filetestiso

For the full list of options and some examples, execute one of the following commands:

Exception calling “Burn” with “2” argument(s): “ISOFileName must be called with the name of the new ISO file to create.”

errorbdm

If you come across the error Exception calling “Burn” with “2” argument(s): “ISOFileName must be called with the name of the new ISO file to create.”, this is a bug in the file BDMworker.dll. Citrix has a private hotfix that provides an updated version of BDMworker.dll that fixes this bug. Contact Citrix to receive the private hotfix.

Udate: This issue has been fixed definitively with the release of Citrix Provisioning Services 7.12. See their fixed issues list here.

Important note:

I have only tested the above steps with Citrix Provisioning Services version 7.8 and 7.9. I am not sure if it is also available or if it works in earlier versions.

You may also like...