rozbeh85
rozbeh85

Reputation: 37

Batch to get systeminfo for Multi remote windows servers

I'm trying to make a batch file to run the systeminfo command.

I am using this command for one server and it's working but I need for multiple servers.

SYSTEMINFO /S ServerName /U My_Domain\my_domain_account /p my_password >C:\Systeminfo.txt

I couldn't use powershell, we have windows server 2003, 2008 and 2008R2.

I need to check Registered Owner and Registered Organization but would be great to have output like above command.

Thank You in Advance

Upvotes: 0

Views: 12246

Answers (1)

Bill_Stewart
Bill_Stewart

Reputation: 24585

Put your list of servers in a text file, one server name per line. Then create a .cmd file that looks like this:

@echo off
setlocal enableextensions
for /f %%s in ('type "serverlist.txt"') do call :PROCESS %%s
goto :END

:PROCESS
systeminfo /s %1 > %1.txt
goto :EOF

:END
endlocal

When you run this script you will have .txt files with system info for each server.

Upvotes: 1

Related Questions