Remote Powershell popup message

℡╲_俬逩灬. 提交于 2019-12-06 15:23:01

I figured this out. I used the msg.exe application to display my message and used powershell Invoke-WmiMethod to execute the command locally on the PC as we have remote messaging disabled:

Invoke-WmiMethod -Class Win32_Process -ComputerName HostPC -Name Create -ArgumentList "C:\Windows\System32\msg.exe * This is a test message."
Patrick M. Dorn

I edited the script samples above with Powershell to make it easier to run with variables so you don't have to edit the file every time.

$server = read-host -prompt 'Input server name';
$message = read-host -prompt 'add text string'; 
Invoke-WmiMethod -Class win32_process -ComputerName $server -Name create -ArgumentList  "c:\windows\system32\msg.exe * $message" 

Thanks to Maumee River for the original answer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!