Question : vbscript to extract  "logon as a batch" "logon as a service" from a list of Servers

I need to write a VBScript on a long list of servers in order to extract the information;   "logon as a batch" "logon as a service"  preferably exported to an excel file.

Can anyone help?

Answer : vbscript to extract  "logon as a batch" "logon as a service" from a list of Servers

Download DumpSec (http://www.systemtools.com/somarsoft), install the download on an XP machine, uncheck "Hyena"; then copy DumpSec.exe and the help file into the folder with the script below.
In the script, specify the path and name of the input file and the output file; the script will generate a comma separated file which you can import into Excel and process there.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
@echo off
setlocal
set ServerFile=test.txt
set ResultFile=test.csv

set DumpsecFile=%~dpn0.tmp
if exist "%ResultFile%" del "%ResultFile%"
for /f "tokens=1" %%a in ('type "%ServerFile%"') do call :process %%a
goto :eof

:process
set Server=%~1
echo Processing %Server% ...
dumpsec /computer=\\%Server% /rpt=rights /outfile=%DumpsecFile% /saveas=csv /noheader
for /f "tokens=1,2 delims=," %%a in ('type "%DumpSecFile%" ^| findstr "SeBatchLogonRight SeServiceLogonRight"') do (
  >>"%ResultFile%" echo "%Server%","%%a","%%b"
)
Random Solutions  
 
programming4us programming4us