Notify All Active vSphere Users (PowerCLI version)

Steve Jin recently posted How to Notify All the Active vSphere Users on his DoubleCloud blog. Below are some functions to make this easy to do via PowerCLI.

Function Get-VIServiceMessage {
    $sessionManager = Get-View SessionManager
    $sessionManager.Message
}
 
Function Set-VIServiceMessage {
    param (
        [String]$message = $(throw "Must specify a message.")
    )
 
    $sessionManager = Get-View SessionManager
    $sessionManager.UpdateServiceMessage($message)
}
 
Function Remove-VIServiceMessage {
    Set-ServiceMessage("")
}

Leave a Comment

Your email address will not be published.