Pages: [1]
Print
Author Topic: script to query connected View sessions - Vmware View 3.1.2  (Read 829 times)
imad77
Guest
« on: October 19, 2010, 01:01:37 PM »

Hi,
Is there any script to query people are logging into our VMWare View 3.1.2? Things like when they logged in, time they were logged in, time they logged out would be great, as well.

Thanks,

Imad
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #1 on: October 19, 2010, 01:53:01 PM »

you could do something like this:

Code:
connect-viserver yourvc
$vms = get-vm *xp*
ForEach($vm in $vms)
{$QueryString = Gwmi Win32_ComputerSystem -Comp $vm
$QueryString = $QueryString.userName
if ($QueryString -eq $null) {$vm | Set-CustomField -Name “Logged in User” -Value "No One Logged In"} ELSE  {$vm | Set-CustomField -Name “Logged in User” -Value $QueryString}}

per: http://virtualisedreality.com/2010/01/24/powershell-scipt-for-vmware-view-vsphere-who-is-logged-into-which-vm/
Logged
Pages: [1]
Print
Jump to: