Thursday, August 19, 2010

Script to verify RPC connectivity and log results

This script will check each server on serverlist.txt, then request for a DOMAIN\USERNAME and a Password. Try to connect to each server (net use \\server\IPC$) and log the results results (connect.txt)


@SetLocal EnableDelayedExpansion
echo off
echo Type user :
echo e.g. Global\_nakame
set /p user=
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>
set /p pass=Password for %user%:<nul
for /f "tokens=*" %%i in ('') do set pass=%%i
echo Processing...
for /F %%i in (serverlist.txt) do (
echo %%i
net use \\%%i\ipc$ /U:%user% %pass%
if !ErrorLevel! == 0 (Echo Connected to %%i with %user% user account >>connect.txt) ELSE (Echo Connection Failed for to %%i with %user% >>connect.txt)

If you want, you can download it from here

Hail to the Pig.


Post a Comment