Home for small wisdoms

14 May 2025

Search through all event logs for specific event using PowerShell

›
 In PowerShell you can search through all event logs for a specific phrase in event Message field This is the oneliner for that Get-WinEvent...
14 November 2023

Last reboot reason using PowerShell

›
 Use this PowerShell command, to obtain last restart reasons: $x = foreach ($e in (Get-WinEvent -FilterHashtable @{logname = 'System...
27 October 2023

Autofit Excel sheets constantly

›
While your Excel sheet open, press ALT+F11 and double-click on the Sheet1 to open the blank window copy this code there Private Sub Workshee...
19 October 2023

Get-WmiObject works on PowerShell 7

›
 Yeah, a lot of people are saying that you cannot use Get-WmiObject in PowerShell 7 and you must use instead Get-CimInstance. Well, this is ...
14 April 2023

Automatic update of Chocolatey packages

›
 If you are installed some software using https://chocolatey.org and want to keep it up to date, then open administrative Command Prompt (cm...
05 April 2023

Create CAA record using PowerShell in Windows DNS

›
 Because CAA records are not natively supported in Windows Server DNS service, then you need to do this manually. I created a PowerShell scr...
08 August 2022

Read IIS log file using PowerShell

›
 Actually you need just few lines $file = '\\iisserver\c$\inetpub\logs\LogFiles\W3SVC1\u_ex220808.log' $headers = ( Get-Content $...
›
Home
View web version

Author

Rauno Mägi
View my complete profile
Powered by Blogger.