Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to bring a prompt to User sitting on a laptop/desktop using Power shell command/script before machine gets rebooted.

$
0
0

Hi Experts,

I am a novice in Powershell and trying to learn PowerShell.

Currently, i need to reboot some 50-60 desktops remotely.

i am using the below powershell command

gc c:\Temp\machineList.txt |%{Restart-computer -computername $_ -force}

It is working perfect for me but what i want is before machine gets rebooted User should get a prompt like "Your machine will be rebooted in 60 seconds, Please save your work".

How i can achieve this in a powershell script.

Thanks in advance.


Daya


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>