Processing a Computer List

S

SimonH

Hi guys hope you can help me with a perl script.

We are running multiple platforms - NT and XP.
I have a computer list in computers.txt
Each system has a local administrator account, let's say it is
<computername>\administrator, with password 'password'.

What I need to do is to:
1) Determine if the system is NT or XP
2) If it is NT, then connect by <computername>\administrator, with password
'password', then write a line to an output file called output.txt the status
of the browser service. So the format of the output.txt would be something
like:
<computername>, operatingsystem, servicename, status
3) If it is XP, then connect by <domain1>\simon, with password 'simtest',
then write a line to an output file called output.txt with the same 4
columns as 2).
4) While the script is running, a status of 'connecting to <computername>
would be great.

Any help greatly appreciated.

Simon
 
S

SimonH

Hi Len!

Thanks for this...but Im really looking at a perl solution for this. Thanks
very much to you anyway. Appreciate it.

l v said:
SimonH said:
Hi guys hope you can help me with a perl script.

We are running multiple platforms - NT and XP.
I have a computer list in computers.txt
Each system has a local administrator account, let's say it is
<computername>\administrator, with password 'password'.

What I need to do is to:
1) Determine if the system is NT or XP
2) If it is NT, then connect by <computername>\administrator, with
password 'password', then write a line to an output file called
output.txt the status of the browser service. So the format of the
output.txt would be something like:
<computername>, operatingsystem, servicename, status
3) If it is XP, then connect by <domain1>\simon, with password 'simtest',
then write a line to an output file called output.txt with the same 4
columns as 2).
4) While the script is running, a status of 'connecting to <computername>
would be great.

Any help greatly appreciated.

Simon

Not a Perl solution, but if you have a copy of Microsoft's srvinfo.exe I
believe you can determine this information without the need to
authenticate.


C:\>srvinfo.exe

Server Name: SPARKY
Security: Users
NT Type: NT Advanced Server - Personal
Version: 5.1
Build: 2600, Service Pack 2
Current Type: Uniprocessor Free
Product Name: Microsoft Windows XP
Registered Owner: len
Registered Organization:
ProductID: xxxxx-OEM-xxxxxxxx-xxxxx
Original Install Date: Wed Sep 25 21:25:42 2002
Domain: Error 2
PDC: Error 2453
CPU[0]: x86 Family 15 Model 2 Stepping 4: 2519 MHz
Hotfixes:
[ServicePackUninstall]:
[Q147222]:
[KB932168]:
[KB931836]:
[KB931784]:
[KB931768]:
[KB931261]:
....
[KB873339]:
[KB873333]:
Drive: [FileSys] [ Size ] [ Free ] [ Used ]
C$ NTFS 38147 15650 22497
D$ NTFS 114479 89074 25405
G$ NTFS 238473 164957 73516
Services:
[Stopped] Adobe LM Service
[Stopped] Alerter
[Running] Application Layer Gateway Service
[Stopped] Application Management
[Running] Windows Audio
[Running] Background Intelligent Transfer Service
[Running] BrSplService
[Running] Computer Browser
[Stopped] Indexing Service
[Stopped] ClipBook
[Stopped] COM+ System Application
[Running] Cryptographic Services
[Running] DCOM Server Process Launcher
[Running] DefWatch
[Running] DHCP Client
....
[Stopped] Network Provisioning Service
Network Card [0]:
Network Card [1]:
System Up Time: 0 Days, 0 Hr, 7 Min, 32 Sec

or


Server Name: serv700
Security: Users
NT Type: NT Member Server - Enterprise
Version: 5.0
Build: 2195, Service Pack 4
Current Type: Uniprocessor Free
Product Name: Microsoft Windows 2000
Registered Owner: home
Registered Organization: home
ProductID: xxxxx-xxx-xxxxxxx-xxxxx
Original Install Date: Sun Dec 17 13:24:27 2000
Domain: Error 2
PDC: Error 1717
IP Address: 192.168.1.37
CPU[0]: x86 Family 15 Model 6 Stepping 5: 3341 MHz
Hotfixes:
[Update Rollup 1]:
[ServicePackUninstall]:
[Q828026]:
[Q147222]:
[KB932168]:
[KB931784]:
[KB931768-IE6SP1-20070219.120000]:
[KB930178]:
[KB929969-IE6SP1-20061220.120000]:
...
[KB329115]:
Drive: [FileSys] [ Size ] [ Free ] [ Used ]
C$ NTFS 15359 11388 3971
D$ NTFS 137267 96209 41058
Services:
[Running] Alerter
[Stopped] Application Management
[Stopped] Background Intelligent Transfer Service
[Running] Computer Browser
[Stopped] Indexing Service
[Stopped] ClipBook
[Running] Distributed File System
...
[Stopped] Wireless Configuration
Network Card [0]:
System Up Time: 5 Days, 18 Hr, 8 Min, 35 Sec
 
D

Dr.Ruud

Beware, multi-posted here, with a different Subject:
"Computer List (Pls hlp!)".
 
S

SimonH

Thanks Bob....really appreciate it.
l v said:
Bob said:
SimonH said:
Hi Len!

Thanks for this...but Im really looking at a perl solution for this.
Thanks very much to you anyway. Appreciate it.

Well then [untested]:

perl -e "print `srvinfo.exe`"

...
C:\>srvinfo.exe

That was my first thought and what I do when there is an existing tool
which gives me exactly what I want.

Simon - you may want to look at Win32::process::Info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top