gparmar Posted October 24, 2005 Share Posted October 24, 2005 Hello,I have been looking out for a vb script which will assign a specific IP based on the MAC address it reads from a txt file.help me achieve this.any tools/how to/guides.thanks Link to comment Share on other sites More sharing options...
hj_fr Posted October 27, 2005 Share Posted October 27, 2005 With DHCP you can do it easily... Link to comment Share on other sites More sharing options...
oioldman Posted October 27, 2005 Share Posted October 27, 2005 I'd go wth hj_fr, use DHCP.Get the PC MAC address add it to DHCP reservations with your desired ip, and bingo all done Link to comment Share on other sites More sharing options...
Yzöwl Posted October 27, 2005 Share Posted October 27, 2005 More information would also be of help to further responders.Have you just got a list of MAC Addresses, have you got a list of MAC Addresses each accompanied by a required IP Address and SubNet. etc. Link to comment Share on other sites More sharing options...
cluberti Posted October 27, 2005 Share Posted October 27, 2005 Something like this vbscript will get you a PC's MAC address:' ----------'Dim objNetworkAdapters, objAdapter, objWMISet objWMI = NothingSet objWMI = GetObject("winmgmts:")' Get a list of IP-enabled adaptersSet objNetworkAdapters = objWMI.ExecQuery("select * from Win32_NetworkAdapterConfiguration where IPEnabled = 1")For Each objAdapter In objNetworkAdapters wscript.echo "Network adapter: " & objAdapter.Caption & " has MAC address " & objAdapter.MacAddress'' ----------What you do with that information is up to you , but at least you can now have the MAC address of each machine. Link to comment Share on other sites More sharing options...
RogueSpear Posted October 28, 2005 Share Posted October 28, 2005 If you have so many computers that you need a script to do this, then that means you really should be running a DHCP server and using reservations. I know that reservations defeat half the purpose of DHCP, but still it's a hell of a lot easier to change a DNS server assignment on 100 workstations via DHCP than to physically visit each one (or even to script that out too). Link to comment Share on other sites More sharing options...
gparmar Posted November 1, 2005 Author Share Posted November 1, 2005 thanks for all the replies. will try out DHCP reservtrions. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now