VMware Cloud Community
cunzlow
Contributor
Contributor

Get desktop status

Hello,

How can I get a view desktop's status programmatically? I want to get the status that is displayed in the view administrator webpage under the "Status" column ( available | provisioned | agent unreachable etc...). I need to know if there are enough available desktops to kick off a test.

I have tried using powercli but the get-desktopvm or get-pool commands do not provide that information. I have also tried obtaining the vmState from the connection servers LDAP directory but that seems to always be "Ready". I have also tried using vdadmin.exe -M but it looks like that command just returns the same vmState from the LDAP data.

Is there any way to do this? How does the view admin web page calculate this state?

0 Kudos
10 Replies
gcollp
Contributor
Contributor

Hello everybody!!!
I have the same problem! :smileycry:
I need find the way to extract the destktop status of the virtual machine (The  status showing in the admin console)... I've searched the best way to do it but all the option that i have give me incomplete information...
Please someone know how get it with whatever of this methods:
CLI Power Shell  -  vdmadmin.exe - ADAM LDAP- another that you know!!!
Thanks to everybody!!
0 Kudos
LucD
Leadership
Leadership

You can use Clint's unofficial View cmdlets. See his Unofficial Advanced VMware View Powershell Cmdlets post.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
gcollp
Contributor
Contributor

Hi,

Thank you so much!!!  Smiley Happy
I saw the link in your post, and I think that it can be very usefull but I have a question... I need implement the solution in a customer in a production enviroment, does it secure?  I am worried about it can cause some problem in the production enviroment?

Thanks for your help!

0 Kudos
LucD
Leadership
Leadership

Since the post states it's unsupported, you'll have to make that call for yourself I'm afraid.

As input for your decission, since you only want to "get" the status, the cmdlet is relatively harmless (as Clinton also mentions in his post).

A "get" cmdlet will not change anything in the configuration.

You could consider the performance of the cmdlets and how they could potentially cause a kind of denial-of-service on the Connection Server.

I didn't see any heavy load on the Connection Server while using these cmdlets.

But it's your decission in the end :smileygrin:


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
gcollp
Contributor
Contributor

Hello LucD!!!
I've decided use it, but i've had this problem :smileycry:!!!
I've downloaded the zip file, I put it file in C:/ Scripts and I am trying to import this module in the power CLI but it show me this error:
Import-Module : The specified module ‘uadv_vmware_view.psm1′ was not loaded because no valid module file was found in any module directory.
At line:1 char:14
+ Import-Module <<<< uadv_vmware_view.psm1
+ CategoryInfo : ResourceUnavailable: (uadv_vmware_view.psm1:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
I dont know if i am doing good the import process or if i need put this files in a specific directory!!!
Please can you help me?
0 Kudos
LucD
Leadership
Leadership

You can use the Import-Module with a full path (in your case C:\Scripts) or

from some pre-defined locations. See the How to Import a Module post for the options and some examples.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
gcollp
Contributor
Contributor

Hello LucD!!!
Thanks so much for your help!
Now,  i've created a PS1 for execute this commands and i can get the information that i need, but i have another problem... when i execute the ps1 from another perl script, the powershell.exe process never finish....
Please, you know how i can force the powershell.exe to finish after execute the get-desktop commands in the ps1....
Thanks for your help!!!
0 Kudos
LucD
Leadership
Leadership

See also my reply to your other thread, but the following should do the trick

powershell.exe -File "yourscript.ps1"

When the script reaches the end, an implicit 'exit' is executed and the powershell.exe binary should return to your Perl script


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
gcollp
Contributor
Contributor

Yes, but I also use the - Non interactive to run the ps1, and the powershell.exe never return to my perl script.

:smileycry:

0 Kudos
LucD
Leadership
Leadership

Just to make sure, you do load the PowerCLI snapin in the script ?

Are there any prompts or confirmations that could cause the script to wait for input ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos