Answer the question
In order to leave comments, you need to log in
How can I show a message to a terminal server user?
I'm writing a script that will remind terminal server users about the imminent password expiration. I ran into a problem: I want the user to pop up a regular warning window (the msg command is not an option - it's ugly), but I can't find how to implement this. Does anyone have any experience they can share?
Answer the question
In order to leave comments, you need to log in
$msg = "Your password will expire in 5 days"
[System.Windows.MessageBox]::Show($msg,"Password Notification","OK","Warning")
1. If ActiveDirectory, then why does the GPO not suit you? - Article
2. Or so:
[reflection.assembly]::loadwithpartialname('System.Windows.Forms')
[reflection.assembly]::loadwithpartialname('System.Drawing')
$notify = new-object system.windows.forms.notifyicon
$notify.icon = [System.Drawing.SystemIcons]::Information
$notify.visible = $true
$notify.showballoontip(10,'WARNING','Automatically logoff after 1 hour of inactivity',[system.windows.forms.tooltipicon]::None)
#creating object os WScript
$wshell = New-Object -ComObject Wscript.Shell -ErrorAction Stop
#invoking the POP method using object
$wshell.Popup("please wait message?",5,"Wait Until Scrip execution",48+4)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question