Open Tech Support
Open 

Tech Support Community
Back to HomeCommunityReviewsGuidesDownloadsLinkageMarketplaceContact Us

 »  Forum Navigation

Home
Post a Question
About Our Site
Support Our Site

What is this site?
Who are we?

Tolitz.Com - The Cynic Eye of the Third World Guy

Enhanced with Snapshots

 

 »  Advertisement


Go Back   Open Tech Support Community > SUPPORT FORUMS > Miscellaneous




Reply

 

LinkBack Thread Tools
Old 02-10-2008, 04:46 AM   #1 (permalink)

Cool Member
 
mccormickp's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 66


VBS Help

Hi All,

I'm not sure if there is many script master on here, but if someone could help or send me to another forum. What I have have been assigned to do is collect mac addresses from over 300 NAS servers on our company network, now I know I can use the below script to get a MAC of a local machne but I can't get it to work reading a text file with all the server names and output to an excel file with the hostname and mac address.

Hope some one can help, sorry if this is in the wrong area.
Paul

Dim objNetwork : Set objNetwork = WScript.CreateObject("WScript.Network")

Dim objFSO
Dim strOpenFile

Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

strOpenFile = inputbox("Enter path to input file.", "Server list required","c:\test.txt")
strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")

For Each objItem in colItems
Wscript.Echo objItem.MACAddress
For Each strAddress in objItem.IPAddress
Wscript.Echo strAddress
Next
Next
mccormickp is offline   Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools








Powered by vBulletin® Version 3.8.2. Copyright © 2000-2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2
Copyright 2000-2008 Open Tech Support.  All Rights Reserved.  Site Design and Development by Tolitz Rosel.