13 Replies Latest reply on Apr 20, 2015 5:24 AM by vfk

    check who is connected with vm Console

    RanjnaAggarwal Master
    VMware Employees

      How to check all those users those who are accessing the particular vm console.

        • 1. Re: check who is connected with vm Console
          RanjnaAggarwal Master
          VMware Employees

          I am looking for all active sessions with vm console.

          • 2. Re: check who is connected with vm Console
            krishna_v78 Hot Shot

            Assuming there are more than 1 concurrent connections to a VM console, if you try to open VM console from your vsphere client, it will display the total number of concurrent vm console sessions count at the top of the VM. Incase if you want to see user name, then you need to dig Events using Tasks and Events tab to really findout who are accessing.

            • 3. Re: check who is connected with vm Console
              RanjnaAggarwal Master
              VMware Employees

              How we can say only those connections are active. Let's assume 4 connections are started with one vm

              first at 1:00 PM

              second at 1:30 PM

              third at 1:45 PM

              forth at 2:00 PM

               

              now last connection that was started at 2:00 PM is closed how we can say that is closed not any other connection is closed because in event tab you will get only this information connected from remote console

              • 4. Re: check who is connected with vm Console
                Hot Shot

                Ranjana,

                 

                 

                AFAIK the answer to your is question is "Not Possible".

                 

                But to open the VM console you should have exclusive rights on ESXi server,if you are trying to open up the console through vSphere client or there should be a user who has the permission to open the VM consoles defined in the vCenter Server. In both the cases you can find out who all as accessed the consoles from the Tasks & Events tab.



                But is there any practical needs for your request?

                 

                 

                ~dGeorgey

                • 5. Re: check who is connected with vm Console
                  MarVista Enthusiast

                  Hello,

                   

                  Here are two methods to view concurrent sessions in VMware.

                  1. From PowerCLI (Using command get-visession)

                  2. From GUI

                   

                  In addition, see link below:

                  List and Disconnect vCenter Sessions | VMware PowerCLI Blog - VMware Blogs

                  Yours,
                  Mar Vista http://pixxar.zapto.org/

                  • 6. Re: check who is connected with vm Console
                    akkayyakapisetti Enthusiast

                    It is more windows than vmware to find who logged on the console

                     

                    Use tsadmin and connect to the remote ip and check who logged into the console

                     

                    Venkat

                    http://www.peeradmin.com

                    • 7. Re: check who is connected with vm Console
                      stana Novice

                      iam using command quser in cmd:

                       

                      C:\Users\vmware_admin>quser

                      USERNAME              SESSIONNAME        ID  STATE   IDLE TIME  LOGON TIME

                      xxx                              console             1  Active      none   9/16/2013 4:43

                      PM

                      >vmware_admin          rdp-tcp#0           2  Active          .  9/16/2013 4:04

                      PM

                      • 8. Re: check who is connected with vm Console
                        OscarDavey Hot Shot

                        Hello,

                         

                        Use command get-visession from PowerCLI to view connected users in VMware.

                        Another way is from GUI.

                         

                        Hope helped you.

                        Take care!

                        • 9. Re: check who is connected with vm Console
                          Hot Shot

                          List all sessions with PowerCLI

                          Function Get-ViSession { 
                              <# 
                                  .SYNOPSIS 
                                      Lists vCenter Sessions.

                                  .DESCRIPTION 
                                      Lists all connected vCenter Sessions.

                                  .EXAMPLE 
                                      PS C:\> Get-VISession

                                  .EXAMPLE 
                                      PS C:\> Get-VISession | Where { $_.IdleMinutes -gt 5 } 
                              #> 
                              $SessionMgr = Get-View $DefaultViserver.ExtensionData.Client.ServiceContent.SessionManager 
                              $AllSessions = @() 
                              $SessionMgr.SessionList | Foreach {   
                                  $Session = New-Object -TypeName PSObject -Property @{ 
                                      Key = $_.Key 
                                      UserName = $_.UserName 
                                      FullName = $_.FullName 
                                      LoginTime = ($_.LoginTime).ToLocalTime() 
                                      LastActiveTime = ($_.LastActiveTime).ToLocalTime() 
                                     
                                  } 
                                      If ($_.Key -eq $SessionMgr.CurrentSession.Key) { 
                                          $Session | Add-Member -MemberType NoteProperty -Name Status -Value "Current Session" 
                                      } Else { 
                                          $Session | Add-Member -MemberType NoteProperty -Name Status -Value "Idle" 
                                      } 
                                      $Session | Add-Member -MemberType NoteProperty -Name IdleMinutes -Value ([Math]::Round(((Get-Date) – ($_.LastActiveTime).ToLocalTime()).TotalMinutes)) 
                              $AllSessions += $Session 
                              } 
                              $AllSessions 
                          }

                           

                          When this function is run it will give you a list of the connected sessions and various useful properties:

                          SNAGHTML366d1b1_thumb2

                          This can obviously be filtered using the standard PowerShell cmdlets to list any sessions which have been idle for over 30 minutes:

                          SNAGHTML367dc9a_thumb2

                          • 10. Re: check who is connected with vm Console
                            ljuarbe4104 Lurker

                            RanjnaAggarwal wrote:

                             

                            How to check all those users those who are accessing the particular vm console.

                            My understanding has always been to look at the VM's events (VM> Task & Events tab > Events) for "A ticket of type mks has been acquired." under the description column  This is basically a request to open the console and it is logged in the events with the user who requested it.

                             

                            Re: A ticket of type mks has been acquired?

                             

                            Hope that helps!

                             

                            -Lenny

                            • 11. Re: check who is connected with vm Console
                              King_Robert Hot Shot

                              Go to the session option in Vcenter server and it will show you the existing session detail who is currently connected the VM Console.

                              1 person found this helpful
                              • 12. Re: check who is connected with vm Console
                                Prakash Enthusiast

                                I've developed a PowerCLI script which can collect the events of all the users who accessed VM console. You can find it here.

                                • 13. Re: check who is connected with vm Console
                                  vfk Expert

                                  Hi, VM console access is authenticated through a ticket session, for the VM in question:

                                  • Go to Tasks & Events
                                  • and look for "A ticket of typemks has been acquired"

                                   

                                  And this should tell you exactly who opened console to a VM.