question

RyanChristensen-3497 avatar image
0 Votes"
RyanChristensen-3497 asked AndreasBaumgarten commented

Script to Send Reboot Message

Hello,

I am trying to figure out how to create a script (PowerShell or Bash) to send a message to multiple computers for the user to reboot at there earliest convenience to install updates. I would like a popup to stay on there desktop until they acknowledge it. I will be sending to multiple computers so if it could reference a text doc with the list of computers that would be great. I will open a Command Prompt or PowerShell with my admin account and run the script. All computers are Windows 10. Thank you for any help you can provide.

windows-server-powershell
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RyanChristensen-3497 ,

Did the answer work for you? Are there any additional questions to this topic?

If you found the answer helpful, it would be great if you please mark it "Accept as answer". This will help others to find answers in Q&A

----------
Regards
Andreas Baumgarten

0 Votes 0 ·
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered

HI @RyanChristensen-3497 ,

maybe this helps:

https://techcognizance.com/2012/08/07/power-shell-script-to-send-message-to-network-computers-2/


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered IanXue-MSFT edited

Hi,

You can try something like below

 $file = 'C:\tmp\com.txt'
 $message = "Computer will be rebooted."
 Get-Content -Path $file | ForEach-Object {
         msg * /server:$_ $message
     }

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.