Home » Windows » Help Desk Processes » [solved] Microsoft windows day to day IT pros powershell commands

[solved] Microsoft windows day to day IT pros powershell commands

The following commands will get you the output with all the details on why your device was rebooted or restarted

 Get-EventLog -LogName system -Source user32 | FT -Wrap

see the output below

 Get-EventLog -LogName system -Source user32 | FT -Wrap

see the output below

How to query for a certificate 

dir cert: -Recurse | Where-Object { $_.SerialNumber -like “51sssjfjfje461e54c1” }

How to run a powershell command against multiple computers 

Create a text file named computers.txt and add the computernames

Run the command to load the text file in Powershell and this will load the all the computers in the Powershell session

$computers = Get-Content -Path C:\temp\Computers.txt

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*