VMware Cloud Community
RanjnaAggarwal
VMware Employee
VMware Employee

check who is connected with vm Console

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

Regards, Ranjna Aggarwal
13 Replies
RanjnaAggarwal
VMware Employee
VMware Employee

I am looking for all active sessions with vm console.

Regards, Ranjna Aggarwal
Reply
0 Kudos
krishna_v78
Enthusiast
Enthusiast

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.

Reply
0 Kudos
RanjnaAggarwal
VMware Employee
VMware Employee

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

Regards, Ranjna Aggarwal
Reply
0 Kudos
admin
Immortal
Immortal

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

Reply
0 Kudos
MarVista
Enthusiast
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

Reply
0 Kudos
akkayyakapisett
Enthusiast
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

Reply
0 Kudos
stana
Contributor
Contributor

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

OscarDavey
Hot Shot
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!

Reply
0 Kudos
admin
Immortal
Immortal

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

Reply
0 Kudos
ljuarbe4104
Contributor
Contributor

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

Reply
0 Kudos
King_Robert
Hot Shot
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.

Prakas
Enthusiast
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.

vfk
Expert
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.

--- If you found this or any other answer helpful, please consider the use of the Helpful or Correct buttons to award points. vfk Systems Manager / Technical Architect VCP5-DCV, VCAP5-DCA, vExpert, ITILv3, CCNA, MCP
Reply
0 Kudos