Last active
March 19, 2021 20:47
-
-
Save Sh1n0g1/b7d3633aafa3bc2fca7785c0f88ea7e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
net session >nul 2>&1 | |
if %errorlevel% == 0 ( | |
echo|set /p="Adding registry 1:" | |
reg add HKLM\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ /v EnableModuleLogging /f /t REG_DWORD /d 1 | |
echo|set /p="Adding registry 2:" | |
reg add HKLM\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames /f /v ^* /t REG_SZ /d ^* | |
echo Powershell logging successfully enabled. | |
) else ( | |
echo Error: You need adminstrator right. | |
) | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment