How to Notify All the Active vSphere Users?

As system administrators, you may have used the feature that sends a message to all users. It’s very helpful when you want to change something that might affect others, or ask for particular attention from new users who log in later.

It’s simply 3 steps as described vSphere Client Help:

Bothered by SLOW Web UI to manage vSphere? Want to manage ALL your VMware vCenters, AWS, Azure, Openstack, container behind a SINGLE pane of glass? Want to search, analyze, report, visualize VMs, hosts, networks, datastores, events as easily as Google the Web? Find out more about vSearch 3.0: the search engine for all your private and public clouds.

  1. From the Home page of the vSphere Client, click Sessions.
  2. Type the message in the Message of the day box.
  3. Click Change.

The message is sent to all the currently login users, and until the message is changed, any new users see the message upon logining to the vCenter.

Now, how to do with the API?

It’s actually fairly simple. As hinted by the steps from above, it’s related to the session management. Just pick up SessionManager managed object, you will find a method like this:

public void updateServiceMessage(String message) throws RuntimeFault, RemoteException 

Note that the above signature is from vSphere Java API. The method in the API doc has _this typed as ManagedObjectReference as its first parameter, which is no longer needed in the Java API.

Even you can change the message, you want to find out what the current message is as well. There is a property called message in the SessionManager. You can use the PropertyCollector, or the simple getter method in Java API as follows:

public String getMessage()

With the API, you can design interesting applications, for example an application that watch an dedicated email account to receive message and post it via the vSphere API.

This entry was posted in vSphere API and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Trackback

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  • NEED HELP?


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.