Home All Groups Group Topic Archive Search About

Need a script to capture computer names in IP range



Author
20 Nov 2007 4:44 PM
Rick Neely
I am needing a script that will scan an IP range on our network and create an
Excel spreadsheet with a list of computernames.  This will allow me to create
other scripts for our specific group and not the entire domain.

Author
20 Nov 2007 8:57 PM
Jeffery Hicks [MVP]
I wouldn't bother with a script. I'd simply use any of the many free network
scanner tools.  Grab one that allows you to export results to a file.
Otherwise you'll have to use command line tools like NBTSTAT or NSLOOKUP and
do a lot of parsing.
For example, nbtstat -A ipaddress should show you the computer name, among
other information.  If you have reverse lookup zones you could also call
nslookup and parse that output.

This is probably do-able in PowerShell as well, and maybe a little bit
easier if you're ready to go down that road.

--
Jeffery Hicks
Microsoft PowerShell MVP
http://www.scriptinganswers.com
http://www.powershellcommunity.org

Now Available: WSH and VBScript Core: TFM
Coming Soon: Windows PowerShell: TFM 2nd Ed.

Show quote
"Rick Neely" <Rick Ne***@discussions.microsoft.com> wrote in message
news:20B54905-E919-4A83-BE91-BBBA96BB77DE@microsoft.com...
>I am needing a script that will scan an IP range on our network and create
>an
> Excel spreadsheet with a list of computernames.  This will allow me to
> create
> other scripts for our specific group and not the entire domain.
Author
21 Nov 2007 4:47 AM
Al Dunbar
Alternately, if you just need to get a list of computers available for
remote scripting, and if you have a naming convention that is OU or
subnet-specific, you could filter the output from the "NET VIEW" command.

/Al

Show quote
"Jeffery Hicks [MVP]" <jhi***@sapien.com> wrote in message
news:B32E3A69-1A73-4921-9FE0-944223A4725C@microsoft.com...
>I wouldn't bother with a script. I'd simply use any of the many free
>network scanner tools.  Grab one that allows you to export results to a
>file. Otherwise you'll have to use command line tools like NBTSTAT or
>NSLOOKUP and do a lot of parsing.
> For example, nbtstat -A ipaddress should show you the computer name, among
> other information.  If you have reverse lookup zones you could also call
> nslookup and parse that output.
>
> This is probably do-able in PowerShell as well, and maybe a little bit
> easier if you're ready to go down that road.
>
> --
> Jeffery Hicks
> Microsoft PowerShell MVP
> http://www.scriptinganswers.com
> http://www.powershellcommunity.org
>
> Now Available: WSH and VBScript Core: TFM
> Coming Soon: Windows PowerShell: TFM 2nd Ed.
>
> "Rick Neely" <Rick Ne***@discussions.microsoft.com> wrote in message
> news:20B54905-E919-4A83-BE91-BBBA96BB77DE@microsoft.com...
>>I am needing a script that will scan an IP range on our network and create
>>an
>> Excel spreadsheet with a list of computernames.  This will allow me to
>> create
>> other scripts for our specific group and not the entire domain.
>

AddThis Social Bookmark Button