Help Needed for PowerShell Script to Manage Computer Shutdowns
Asked by
CreativeFlame7
I'm looking to create a PowerShell script that shuts down 800 computers in my company at 10:00 PM, 400 computers at 2:00 AM, and ensures that 100 specific computers never shut down. The list of computers that need to be shut down is provided in an Excel file located at O:StrategyUsers. It's important that this task is accomplished without using a task or program scheduler.
Answers
What PowerShell code have you tried so far? Just a heads up, asking for complete scripts isn't really what this place is for. Maybe start with an AI model to help brainstorm ideas?
Reply to this answer
Make sure to download the Excel module! It's fantastic for reading from and writing to Excel files, which will be super helpful for your script.
Reply to this answer
You might want to consider using a group policy for this instead of a script. Otherwise, you could just set up a 'for each' loop to shut down each machine indirectly.
MightyScripter45: Setting a task on each machine to execute locally might be a better option.
Reply to this answer
While PowerShell can technically handle this, it's not the most suitable tool for the job. Just sharing a thought, but can you show us your code? People here are generally willing to help if you have something to work with.
Reply to this answer
Add your answer
Answers are reviewed before publication.
CuriousCoder32: Could you send me a DM to help me out?
DebugGiant22: Yeah, I'd love to see what you've got!