visan35's Posts

Need help to power off the assigned vdi VMs when idle or in logged off state for certain time ( e.g 2 weeks). I am using horizon cloud on azure service to provide dedicated assigned vdi VM to ... See more...
Need help to power off the assigned vdi VMs when idle or in logged off state for certain time ( e.g 2 weeks). I am using horizon cloud on azure service to provide dedicated assigned vdi VM to users. To save azure running cost I would like to power off and deallocate vdi VMs that are idle or disconnected for 2 weeks or more. I have configured power management schedule to keep VMs running 24*7 as I can't determine usage pattern as all users are full time employees. This keeps VM available Everytime and enables users to connect immediately when they connect. If the power management option is not configured the idle VMs are automatically powered off after few hours and the user has to wait for 10 mins  till VMs power on which is annoying. Could anyone please share ideas or azure automation script  to achieve this task?
This script works perfectly fine. Thank for summarizing the various comments and redrafting the script. Appreciate your help.
Hi Jose I got this below error Get-ADGroupMember : Directory object not found At line:1 char:30 + ($PoolEntitlments | foreach {Get-ADGroupMember $_.distinguishedName}) +                   ... See more...
Hi Jose I got this below error Get-ADGroupMember : Directory object not found At line:1 char:30 + ($PoolEntitlments | foreach {Get-ADGroupMember $_.distinguishedName}) +                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : ObjectNotFound: (CN=ab test05,OU...ten,DC=co,DC=jp:ADGroup) [Get-ADGroupMember], ADIdentityNotFoundExcep    tion     + FullyQualifiedErrorId : ActiveDirectoryCmdlet:Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException,Microsoft.ActiveD    irectory.Management.Commands.GetADGroupMember After I run the below code $entitledusers = ($PoolEntitlments | foreach {Get-ADGroupMember $_.distinguishedName | where {$_.objectclass -eq 'user'}}).count I have installed the RSAT module.
Thanks for your quick reply. Will this cript work even when you have multiple AD groups entitled to same pool? Will it query the user count by adding members in all the AD groups to fund the t... See more...
Thanks for your quick reply. Will this cript work even when you have multiple AD groups entitled to same pool? Will it query the user count by adding members in all the AD groups to fund the total entitled users count?
I will try your script. It seems to do what I am looking for. Is it possible to include below conditions in the script: 1. I have around 18 full and linked clone pools. I like to query all the... See more...
I will try your script. It seems to do what I am looking for. Is it possible to include below conditions in the script: 1. I have around 18 full and linked clone pools. I like to query all the pools at same time once in a day and expand pool size if their are no VMS available. 2. In addition to entitling the pool to the AD groups their are some pools that have individual users entitled to it. How can we modify script to include these 2 conditions? Visan.
I am looking for a script that will automatically add VM to pool when number of vms are less than the users entitled to pool. Currently users are entitled thru a security group. Admins don't k... See more...
I am looking for a script that will automatically add VM to pool when number of vms are less than the users entitled to pool. Currently users are entitled thru a security group. Admins don't know if enough VMS are available in pool unless we manually go and check the pool size and free vms available. We provision VM's in advance and not on demand as it usually takes 15 to 20 mins to provision a vm. Visan.
From last few days I am facing a unique issue. The VDI VM's in the linked clone pool do not get automatically assign to the new users when they try to connect to VDI. They are entitled to the po... See more...
From last few days I am facing a unique issue. The VDI VM's in the linked clone pool do not get automatically assign to the new users when they try to connect to VDI. They are entitled to the pool. Its happenning with all the pools and I suspect its issue in the view connection and ldap. As a workaround I have to manually assign the users to the vdi. VMware support is investigating the issue from last 3 days. But they can't find the cause of issue yet. visan
Thanks. I will five this a try tonight.
Currently we have to manually expand the pool when the entitled users exceed the number of VMS in pool. Can we automate this to always keep some free vms available for new users? Script that can... See more...
Currently we have to manually expand the pool when the entitled users exceed the number of VMS in pool. Can we automate this to always keep some free vms available for new users? Script that can automatically expand the size of the pool when their are not enough free vms available in pool. We use dedicated persistent linked and full clone pools. Visan
The new VM's added to full clome pool are in agent unreachable state and have same name as master template. I suspect the sysprep and customization is failing but not sure how to troubleshoot ... See more...
The new VM's added to full clome pool are in agent unreachable state and have same name as master template. I suspect the sysprep and customization is failing but not sure how to troubleshoot this issue. Any pointers to KB or logs would be helpful. The master template is Windows 7 and in the domain. Using Horizon 7 with Vcenter 6. Visan
Hi Magneet Your command works great. It's just the vdi VM must be in powered on state and available. If thetvm is powered off or in a disconnected state than it gives erroe. But its not so big... See more...
Hi Magneet Your command works great. It's just the vdi VM must be in powered on state and available. If thetvm is powered off or in a disconnected state than it gives erroe. But its not so big issue as I can power cycle the VMS before deleting them. Thanks for your quick response. Visan
Magneet Thanks for your quick reply. The desktop pool type is "Automated Desktop Pool" Can we remove the VM without querying the desktop pool id? I am able to create list of user name and the... See more...
Magneet Thanks for your quick reply. The desktop pool type is "Automated Desktop Pool" Can we remove the VM without querying the desktop pool id? I am able to create list of user name and the vm name to delete. I get below message. c:\$services1.Desktop.Desktop_RemoveMachinesFromManualDesktop((get-hvpool -poolname testpool02).id,(Get-HVMachine -MachineName tpool02-003).id) Exception calling "Desktop_RemoveMachinesFromManualDesktop" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidArgument ErrorMessage : Desktop should be manual type ParameterName : id" At line:2 char:1 + $services1.Desktop.Desktop_RemoveMachinesFromManualDesktop((get-hvpoo ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException     + FullyQualifiedErrorId : VimException
Can someone please 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 ... See more...
Can someone please 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