Enabling WinRM Logging on Windows

WinRM stands for Windows Remote Management and it is logging is useful in Windows to find out to troubleshoot any issues that might occur when a package is being deployed remotely into IIS server on a windows machine. This is also useful in remote management of servers as we can execute commands on the target machines without the need to log into those machines, in such case WinRM logging would be very useful. Let us see how to enable WinRM logging in Windows

To enable WinRM logging in any windows server run the below command

#This will enable WinRM logging on Windows
Get-WinEvent -ListLog *winrm* | % {echo y | wevtutil.exe sl $_.LogName /e:true}


To check whether WinRM logging has been enabled

#Double checking to see whether WinRM is enabled
Get-WinEvent -ListLog *winrm*  | fl *


To disable the WinRM log you can run something like this

#Disabling WinRM logging
Get-WinEvent -ListLog *winrm* | % {echo y | wevtutil.exe sl $_.LogName /e:false}

#And check whether WinRM logging is disabled
(Get-WinEvent -ListLog *winrm*).isenabled

You may also like...