VMware Horizon Community
skneuss
Contributor
Contributor

How can I find out which VM belongs to which User?

Hello

How can I find out which VM belongs to which User?

I would like to grab this data and fill this into another SQL-Database.

Thank you

Simon

Tags (1)
0 Kudos
12 Replies
mittim12
Immortal
Immortal

I assume that you are using a persistent pool.  If so that information would be available in the View Admin console which means it should be available in the View ADAM database.  

0 Kudos
tacticsbaby
Expert
Expert

One way to find out who owns the VM is through the View admin console. It will show you who owns it. This is if the VM is persistent. You can also find out who owns a VM through the command line utility. In order to use this tool you will need to login to the connection server and issue the following command:

vdmadmin –R –i <machine_name>

This command will show you who owns the VM and is a good way to script things if needed. Hope this helps.

0 Kudos
skneuss
Contributor
Contributor

Yes, I am using Persistent Linked Clone Pools.

How can i access to the ADAM-db? Or run a Script to export the content once a day?

0 Kudos
tacticsbaby
Expert
Expert

If you are familiar with batch scripting just make a batch script that uses the commands I gave you to cycle through your list of VMs for which you wish to gather user information. Here is an example of what to do:

1) Using RDP or the console log into the connection server.

2) Open a command prompt and then change the directory to: "C:\Program Files\VMware\VMware View\Server\bin" Note that this path assumes your connection server is installed on the C:\ partition of your connection server.

3) Now issue the command I gave you against one or more VMs (note that if you wish to do more you need to make a script)

example usage:

vdmadmin –R –i <machine_name>

Try this out and let me know how it works.

0 Kudos
DKatman
Enthusiast
Enthusiast

I am not sure why you might want to do this daily as linked clones should pretty much stay the same perion to the same desktop unless someone actively changes this.

I just went through what I would need to do to accomplish what I think you want.

Go to the admin console by going to:

https://(Your connection server/admin

Log in with the proper credentials.

I clicked the desktops in the menu below on the left had side.

On the right pane, make sure at the stop (ish) it is showing all and not jsut problem desktops.

At the top, on the right hand side, you will see an icon for a disk. Click it.

It saves the list as a csv. That should give you what it seems like you are looking for.


Good Luck,
Dave

skneuss
Contributor
Contributor

The command doesn't work at me:

C:\Program Files\VMware\VMware View\Server\bin>vdmadmin -R -i P1V-071
No user could be identified as being the first connected to P1V-071

But this is my VM, and i am connectet.

0 Kudos
skneuss
Contributor
Contributor

@DKatman

Good idea, but I should have the data refreshed automatically.

I need the data to fill up our client inventory.

At the moment we roll out a lot of VM's and then it makes sense when this process can be automated.

0 Kudos
tacticsbaby
Expert
Expert

Is this pool persistent? Has anyone logged into the VM you listed before? This command should work even if you are logged into the VM. Check the firewall settings on your VM to make sure that there is nothing blocking the agent.

0 Kudos
mittim12
Immortal
Immortal

You can access the ADAM database with the instructions below.   Also here is a link to the integration guide for View,  http://www.vmware.com/pdf/view-46-integration.pdf.

  • Run the ADSI Edit utility from Start > Programs > ADAM menu.
  • Select Action > Connect to. The Connection Settings dialog box appears.
  • Select Distinguished name (DN) or naming context.
  • Enter DC=vdi,DC=vmware,DC=int and click OK. The ADAM ADSI Edit main window appears.

Be careful when looking through or changing the ADAM database.   This is where your View configuration info is held so a backup should be made before changes are made.

0 Kudos
skneuss
Contributor
Contributor

Thanks, but is there a way to automatically export the informations? (like to another sql-database)

0 Kudos
skneuss
Contributor
Contributor

Is there no solution for my problem?

My task is to export automatically the name of the VM and the user which is usually connectet to the VM.

We are using linked clones with novell (that means when a user is connectet to a VM, the message "unassigned user is connectet" appears, because the SID's are not the same in the AD and de eDirectory, but this is another problem Smiley Happy).

In the View administrator i can see which user is connectet, and i need this information to import in our intranet-system via SQL.

0 Kudos
stealth916
Contributor
Contributor

This is a problem in any environment, in or out of VDI.   I use a simple command or two in the Windows AD login script, which runs on the VDI desktop each time a user logs in, to record the time, date, user name and machine name, to a text file on a hidden share.

Something like this in your Windows login script will write out a single master log file.

echo %DATE% - %TIME% - %USERNAME% logged into %COMPUTERNAME% >> \\shareserver\hiddenshare$\login_log.txt

EVEN MORE USEFUL:

You can also write a separate log file for every machine name, which records the user logging in, and vice versa for the users.

This line will create a text file for each VDI machine, and the contents of each file will be the username with timestamp of each login:

echo %DATE% - %TIME% - %USERNAME% logged in >> \\shareserver\hiddenshare$\%COMPUTERNAME%.txt

This line will write a logfile for each user, and record the machines they log into.

echo %DATE% - %TIME% - logged into %COMPUTERNAME% >> \\shareserver\hiddenshare$\%USERNAME%.txt

We have been doing these simple logs for years, and let me tell you that having these logs is hugely helpful in the day to day life of helpdesk and admin folks, for all manner of reasons.

The users must have modify access to the hidden share, therefore it is not secure enough for some organizations and probably shouldn't be used to prove a murder case either.  But in most environments the information recorded is benign enough, and the benefits are many.

0 Kudos