Andy_Imm
Contributor
Contributor

Log off local console user

This is my environment;

VC is Windows 2003 Server. The VC runs VCB scheduled jobs which is run in batch, using some VI Perl Toolkit. I have 3 ESX hosts.

Prior to running the VCB from my VC, I would like to log off any user connected to the local console.

Any ideas?

Thanks in advance

0 Kudos
4 Replies
admin
Immortal
Immortal

You can use TerminateSession Method. This will Log off and terminate the provided list of sessions. It required mor to the sessionManager and the list session id's to terminate.

The set of sessions are terminated sequentially, as specified in the list.

0 Kudos
Andy_Imm
Contributor
Contributor

I am not so familiar with the terminatesession method. Is this something that you run from the VC against a vm?

Thanks

0 Kudos
admin
Immortal
Immortal

VI SDK contains a method called TerminateSession. If you provide to this method an array of Session IDs, it will terminate each of these session. You can write code snippet to achieve this using the VI Perl Toolkit/ Java / C# using VI SDK.

TerminateSession is defined on the managed object SessionManager. You can retrieve the service content, get managed object reference to sessionManager and invoke this method.

This operation is supported on both VC and ESX. Priveleges required to perform this operation are Sessions.TerminateSession. Please find more details in the VI SDK Reference Guide.

Andy_Imm
Contributor
Contributor

Dkaur,

I will have to look into this one. Looks like it may be helpful.

Thx

0 Kudos