VMware Cloud Community
visan35
Enthusiast
Enthusiast

New PowerCLI Script to remove the VDI VM .

Can someone help to automate below task:

I am using linked clone and full clone VDI pool. A VDI is persistently assigned to the user's on first logon. When the user's leave the company the AD user account is disabled or deleted but the desktops are still assigned to this user account.  I would like to run a script once in a week that can find and remove the VM of the user's that don't work in company anymore. I like to do be below:

1. Compare the list of AD accounts and the VDI users.

2. Generate list of VDI VM's and user's assigned which can be removed from the VDI pool and the VCenter.

3. Remove the VDI VM permanently

So far I am able to generate the list of user names and VDI VM's that can be removed.

But don't know how to remove or unassigned the user from the connection server.

Visan

0 Kudos
0 Replies