To do this with SCCM, would you guys just add a restart command at the end of the .cmd, or would you call the .cmd from with a batch file and put the reboot in the batch file, or would you package it some other way?
Joe Heaton
Managed Services and Operational Support Unit
Information Technology Operations Branch
Data and Technology Division
CA Department of Fish and Wildlife
1700 9th Street, 3rd Floor
Sacramento, CA 95811
Desk: 916-919-5816
I’d add a restart (shutdown -r -f -t 0) at the end of the cmd.
--
You received this message because you are subscribed to the Google Groups "ntsystemcenter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntsystemcente...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ntsystemcenter/SJ0PR09MB66867D7C9B399BEB818658EEAA759%40SJ0PR09MB6686.namprd09.prod.outlook.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntsystemcenter/9e76407df7034e3c97ab54e6a7acde14%40smithcons.com.
Thanks Michael, that sounds like a good plan.
I also have a Powershell script I’m trying to deploy. I went the “easy” route first, just by putting into the Software Library – Scripts area, then testing by telling a specific machine to run it. Unfortunately, the script also didn’t have a restart mechanism in it. I’m thinking of adding:
Start-sleep -Seconds 300
Restart-Computer
Does that seem appropriate?
From: ntsyste...@googlegroups.com <ntsyste...@googlegroups.com>
On Behalf Of Michael B. Smith
Sent: Tuesday, December 14, 2021 3:58 PM
To: ntsyste...@googlegroups.com
Subject: [ntsystemcenter] RE: Deploying a .cmd file with a reboot
WARNING: This message is from an external source. Verify the sender and exercise caution when clicking links or opening attachments.
To view this discussion on the web visit https://groups.google.com/d/msgid/ntsystemcenter/9e76407df7034e3c97ab54e6a7acde14%40smithcons.com.
The Restart-Computer command has a delay option. However, you don’t need to go to that extreme if you don’t want to. A simple
shutdown -r -t 300
would do the same thing and has other options that might give you more information to the user, if a user will see it. That being said, there are some features of the Powershell Restart-Computer command that might help with your task, such as waiting
to reboot until certain processes or particular services become available. The Restart-Computer help page has a lot of useful information and examples. I’ve used it quite a bit for restarting computers via script. However, I usually use Invoke-Command to run
shutdown -r -t 0
on a machine.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/restart-computer?view=powershell-7.2&viewFallbackFrom=powershell-6
Thanks,
Matt Helton
Assistant System Administrator
Library Information Technology Services
Milner Library, Room 177
Illinois State University
Office: 309-438-2876
Help Desk: 309-438-8399
Help E-mail: librar...@ilstu.edu
From: ntsyste...@googlegroups.com <ntsyste...@googlegroups.com>
On Behalf Of Hood, Jeff
Sent: Wednesday, December 15, 2021 10:12
To: ntsyste...@googlegroups.com
Subject: [ntsystemcenter] Re: Deploying a .cmd file with a reboot
[This message came from an external source. If suspicious, report to ab...@ilstu.edu]
To view this discussion on the web visit https://groups.google.com/d/msgid/ntsystemcenter/SA1PR09MB80324466B86D2BCF120AB56A8E769%40SA1PR09MB8032.namprd09.prod.outlook.com.