Script untuk mengecek spesifikasi Windows Server 2008 keatas

@echo off
:: Get hostname and IP address
:: for /f "tokens=2 delims==" %%A in ('"wmic computersystem get name /value | findstr Name"') do set HOSTNAME=%%A
::for /f "tokens=2 delims=:" %%A in ('"ipconfig | findstr /i "IPv4 Address""') do set IP=%%A
::set IP=%IP:~1%
::set OUTPUT_FILE=%HOSTNAME% - %IP%.txt
::set REAL_FILE=%HOSTNAME% - %IP%.txt
 
set OUTPUT_FILE=windowsinfo.txt
 
:: Clear existing file
if exist "%OUTPUT_FILE%" del "%OUTPUT_FILE%"
 
:: CPU Info
echo =============== CPU Information =============== > "%OUTPUT_FILE%"
wmic cpu get Name,NumberOfCores,MaxClockSpeed /format:list > "%OUTPUT_FILE%"
 
:: Memory Info
echo. > "%OUTPUT_FILE%"
echo =============== Memory Information =============== > "%OUTPUT_FILE%"
wmic memorychip get Capacity,Manufacturer,Speed /format:list > "%OUTPUT_FILE%"
 
:: Disk Info
echo. > "%OUTPUT_FILE%
echo =============== Disk Information =============== > "%OUTPUT_FILE%"
wmic logicaldisk get Caption,FileSystem,Size,FreeSpace /format:list > "%OUTPUT_FILE%"
 
:: OS Info
echo. > "%OUTPUT_FILE%"
echo =============== Operating System Information =============== > "%OUTPUT_FILE%"
wmic os get Caption,Version,BuildNumber /format:list > "%OUTPUT_FILE%"
 
:: Mountpoint Info
echo. > "%OUTPUT_FILE%"
echo =============== Mountpoint Information =============== > "%OUTPUT_FILE%"
wmic volume get DriveLetter,FileSystem,Label,Capacity /format:list > "%OUTPUT_FILE%"
 
:: Hosts File
echo. > "%OUTPUT_FILE%"
echo =============== Hosts File =============== > "%OUTPUT_FILE%"
type %SystemRoot%\System32\drivers\etc\hosts > "%OUTPUT_FILE%"
 
:: User and Group Info
echo. > "%OUTPUT_FILE%"
echo =============== User and Group Information =============== > "%OUTPUT_FILE%"
net user > "%OUTPUT_FILE%"
echo. > "%OUTPUT_FILE%"
net localgroup > "%OUTPUT_FILE%"
 
:: Ulimit Configuration
echo. > "%OUTPUT_FILE%"
echo =============== Ulimit Configuration =============== > "%OUTPUT_FILE%"
echo "Not applicable on Windows." > "%OUTPUT_FILE%"
 
:: Installed Software and Versions
echo. > "%OUTPUT_FILE%"
echo =============== Installed Software and Versions =============== > "%OUTPUT_FILE%"
wmic product get Name,Version /format:list > "%OUTPUT_FILE%"
 
:: Inbound Connections
echo. > "%OUTPUT_FILE%"
echo =============== Inbound Connections (IP and Port) =============== > "%OUTPUT_FILE%"
netstat -an | findstr LISTENING > "%OUTPUT_FILE%"
 
:: Outbound Connections
echo. > "%OUTPUT_FILE%"
echo =============== Outbound Connections (IP and Port) =============== > "%OUTPUT_FILE%"
netstat -an | findstr ESTABLISHED > "%OUTPUT_FILE%"
 
:: IP Tables
echo. > "%OUTPUT_FILE%"
echo =============== IP Tables =============== > "%OUTPUT_FILE%"
route print > "%OUTPUT_FILE%"
 
echo Output saved to %OUTPUT_FILE%
pause

You cannot comment on this entry