Best Practices Preparing a Provisioning Services vDisk

1 Shares

In this blog post I will show you my Prepare for PVS script that contains Best Practices obtained after years of experience with Provisioning Services.

Let’s say you’re going to run Windows Updates. Well since you’ve already launched the Target Optimizer tool, that services is disabled and you need to head into services, enable and start it. Run Windows update and all good. When the update is finished you shutdown the machine and switch from Private to Standard Mode.

What you didn’t remember was to reboot the server for Windows Update to complete it’s updates. What happens now, is that every time your servers reboot, Windows Update will kick in and finish it’s things.

So being only one administrator doing all the procedures is one thing, but when you hand over the solution to your customer or maintenance team, everybody would probably do this differently, forgetting to flush DNS and so on.

So this script will do all these thing for you. Just teach your staff to always run the script after maintenance.

Prerequisites :

Copy Wuinstall to C:\Windows. Run XenAppCloning tool, add your free license and then configure your settings and save the settings to the configuration file.

Extract the XAUpdate script to C:\XA65Update, rename the script to XA65Update.cmd and configure the settings required inside that script.

Copy the content below into C:\Program Files\Citrix\Prepare for PVS.cmd

To get ride of this annoying boot screen

you just added HKLM\Software\Citrix\ProvisioningServices\SkipBootMenu to your PVS servers. Now your maintenance / test machine will automatically boot to the newest version of the vDisk.

Please be aware that this doesn’t work on Provisioning Services 6.2 hosted on Windows 2012. The good news though, the KMS bug has finally been fixed in Provisioning Services 6.2 (part of Project Excalibur Tech Preview).

So when you e.g. want to patch your Provisioning Services image with the latest Citrix Hotfixes, you just select that option and off you go. The server is rebooted automatically and when it comes back online you just run through the script another time and this time the server will be shutdown ready for you switching from private to standard mode.

If you have any other Best Practices for Provisioning Services, please leave a comment below and share with the community.

1 Shares

Automation Framework Community Edition

The fastest way to build your lab environment.

Virtual Expo

Friday 30th of September 2022

9 thoughts on “Best Practices Preparing a Provisioning Services vDisk”

  1. I’m using very much the same procedure. Here are some additional stuff. If using MS antivirus, run a prescan on the image:
    net start MsMpSvc
    echo Start antivirus prescan
    “C:\Program Files\Microsoft Security Client\Antimalware\MpCmdRun.exe” -Scan -Scantype 1
    net stop MsMpSvc

    Reply
  2. Hi

    A couple of weeks ago, I’ve published a power shell script that I use to semi-automatically prepare a XenApp 6.x server for imaging with PVS. It automates the following steps:

    – Investigate the PVS’ Personality.ini in the root of the system drive in order to determine the disk mode (read-write, read-only, or started from local HD)
    – Start the Citrix IMA service
    – Query XenApp Server Load. Exit if the query fails. Exit if the XenApp server count is below 3.
    – Run XenAppConfigConsole to prepare the server for imaging. (Based on the script user’s choice locally stored XenApp database information will be either kept or cleared from mf20.dsn and LGPO. Default is keep db information. If you choose to clear them you need to provide DB information through GPO.)
    – Clear XenApp related caches (LHC and RADE)
    – Clear Citrix User Profile Manager’s cache
    – Resync time
    – Update GPO settings
    – Clear network related caches (DNS and ARP)
    – Clear WSUS Client related settings
    – Clear event logs
    – Based on the findings in Step 1, suggest a convenient main action, that is either “Exit” (if we’re in maintenance/private w/ read-write vdisk access), or “Invoke ImagingWizard” (if we started from local HD), or “Invoke XenConvert” (reverse imaging scenario w/ read-only vdisk access)

    http://www.out-web.net/?p=1164

    Fps

    Reply
    • Hi Frank, I came across your script and wanted to know if you could throw any light on how to possible ways of scripting the ImagingWizard.exe (PVS 7.x) prompts:

      Server Name
      Credentials (optional)
      Create new vDisk
      User existing vDisk
      vDisk Name
      Store
      vDisk Type
      vDisk block size
      MS Licensing options
      Image volumes
      Target device name
      MAC
      Collection
      Optimize

      I couldn’t find any switches or config file into which the settings are saved and read from when the machine reboots.

      Any ideas??

      Thanks.

      Reply
  3. Quick question on the script wouldn’t you want to delete any folders before doing the defrag?

    Reply

Leave a Comment