Processing a Computer List

Discussion in 'Perl Misc' started by SimonH, Jun 2, 2007.

  1. SimonH

    SimonH Guest

    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
    SimonH, Jun 2, 2007
    #1
    1. Advertising

  2. SimonH

    SimonH Guest

    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" <> wrote in message
    news:...
    > SimonH wrote:
    >> 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
    >
    >
    > --
    >
    > Len
    SimonH, Jun 2, 2007
    #2
    1. Advertising

  3. SimonH

    Dr.Ruud Guest

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

    --
    Affijn, Ruud

    "Gewoon is een tijger."
    Dr.Ruud, Jun 3, 2007
    #3
  4. SimonH

    SimonH Guest

    Thanks Bob....really appreciate it.
    "l v" <> wrote in message
    news:...
    > Bob Walton wrote:
    >> SimonH wrote:
    >>> 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.
    >
    > --
    >
    > Len
    SimonH, Jun 3, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. A. M. G. Solo
    Replies:
    0
    Views:
    540
    A. M. G. Solo
    Jan 13, 2006
  2. A. M. G. Solo
    Replies:
    0
    Views:
    790
    A. M. G. Solo
    Jun 8, 2006
  3. Replies:
    0
    Views:
    348
  4. A. M. G. Solo (do not reply to this email address)
    Replies:
    0
    Views:
    728
    A. M. G. Solo (do not reply to this email address)
    Nov 8, 2006
  5. A. M. G. Solo
    Replies:
    0
    Views:
    737
    A. M. G. Solo
    Dec 5, 2006
Loading...

Share This Page