VMware View PowerShell AD LDS Set-State Function

12/11/2012

Automation is system administrator’s best friend. Automating repetitive tasks is a key enabler in most IT environments. Whilst many of the desktop pool changes in VMware View can be made via PowerShell, not all objects are exposed.

I created the PowerShell function below and it will change a desktop pool property state in Active Directory Lightweight Directory Services database key. The function uses the PoolID property to receive an object representation and set the new state in the AD LDS database.

IMPORTANT: Interacting with AD LDS database is not supported by VMware. You may use the information and scripts below on your own risk. It’s recommended to test your solution in a development environment before applying in production.

Here are some AD LDS examples that cannot be managed via PowerShell:

pae-CBRCEnable: boolean (optional, default true)

pae-CBRCCacheRefreshInterval

pae-CBRCCacheRefreshBlackout

pae-CBRCCachedDiskTypes

pae-VmOperationTimeout

pae-VmDampFactor

pae-VmProvSuspendOnError

The PowerShell function below can executed as is or as part of a module.

Simply modifying $objMachine, as bellow, will allow you to interact with virtual desktop objects and gain access to many more AD LDS keys that control individual desktops. To make that happen just replace the line bellow on the main code and use the virtual desktop display name as PoolId.

Share this:

2 comments

Mitja B.

Not on a very high standard of the View PowerCLI cmdlets compared to vSphere PowerCLI. And there hasn’t been a single new cmdlet introducted since the first version. Such a shame having to do hacks like this to get things automated.