Avatar of Len Kally
Len KallyFlag for United States of America

asked on 

PowerShell script to find out who rebooted a machine.

Does anyone know if there is a powershell script that can find out when a machine was last rebooted and by who rebooted the machine.     This would be a remote machine, and I would have the machine name.     Specifically between a specific date and time.

Thanks
Powershell

Avatar of undefined
Last Comment
Len Kally
Avatar of FOX
FOX
Flag of United States of America image

you can run the below command on the machine in question

Get-WinEvent -FilterHashtable @{logname = 'System'; id = 1074} | Format-Table -wrap


ref link: https://www.whatsupgold.com/blog/how-to-find-restart-info-for-machines-on-your-network-using-powershell-and-windows-event-logs
ASKER CERTIFIED SOLUTION
Avatar of Sam Jacobs
Sam Jacobs
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Len Kally
Len Kally
Flag of United States of America image

ASKER

wow your the best, and I am learning powershell, I will check it out.  
thanks
SOLUTION
Avatar of Sam Jacobs
Sam Jacobs
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Len Kally
Len Kally
Flag of United States of America image

ASKER

thanks I will try it in a couple of days.  :)
Powershell
Powershell

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.

27K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo