Windows System Administrator
NTP
Group Policy
Windows Server Audit Policy
Backup To backup existing auditing settings: auditpol /backup /file:C:\Temp\Audit.txt Restore ...
GPO WMI Filters
Hostname Filter Select * From Win32_ComputerSystem Where Name = "ComputerName" Windows 2019 D...
Reset GPO
To clear Local GPO Delete everything inside the GPO folder RD /S /Q "%WinDir%\System32\GroupPol...
Scripts
Get AD User Last Logon and Last Logon AD Server Script
Save this as .ps1 file and run as admin in the Domain Controller Import-Module ActiveDirectory ...
KMS Activation Script
Save this at .bat file and run as admin @echo off :: For unattended mode, run the script with...
Get AD Group Member List Script
Save this as .ps1 file and run as admin in Domain Controller. Simple $groups = (Get-ADGroup -Fi...
Reset Local Account Script
Change line 8 and 9. # Check if the script is running as an administrator if (-not ([Security.P...
Offline WSUS Scan Script
Step 1 - Download Wsusscan2.cab file Download Wsusscn2.cab from official MS website and save it ...
Net User Examples
Local User The command net user is the same as the PowerShell command Get-LocalUser. Command fo...
Test TCP Port
To test TCP connection if open in the destination address PS C:\Windows\system32> tnc 10.1.1.94 ...
Disable TLS 1.0 & 1.1
Copy this and save it into a registry file (disableTLS.reg).Run the file as admin. Windows Regis...
Set Time Zone via CMD
Using Command Prompt Get current time zone. tzutil /g Get all the time zone list in the system...
Harden IIS
Import-Module IISAdministration Get-IISAppPool $apppoolname = Read-Host 'What is the Applicat...