jh270
asked on
Powershell Script
Hi Experts,
Can anyone help me out with a task I need to implement?
I have no real experience with scripting, but one of our clients needs me to renumber a bunch of his server NIC's and asked me to do it in Powershell.
Any help would be appreciated
Can anyone help me out with a task I need to implement?
I have no real experience with scripting, but one of our clients needs me to renumber a bunch of his server NIC's and asked me to do it in Powershell.
Any help would be appreciated
ASKER
I wish I could tell you if that was it :-)
If this script will renumber multiple NICs, then yea that should do it. The customer has about 30 VM's that he wants to renumber. These VM's are new, but the IP addresses are already assigned to other VMs that he is going to de-commision. So, he's looking to replace the IP's from the old VM's to the new ones, and asked that I script it for the sake of efficiency.
If this script will renumber multiple NICs, then yea that should do it. The customer has about 30 VM's that he wants to renumber. These VM's are new, but the IP addresses are already assigned to other VMs that he is going to de-commision. So, he's looking to replace the IP's from the old VM's to the new ones, and asked that I script it for the sake of efficiency.
Then, no, the above code doesn't do what you want.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
PowerShell code to Change IP assigned to a MAC Address
There is more detail at the site.
#change/assign $hostIp to a valid IP address
(gwmi -Class Win32_NetworkAdapterConfiguration | where { $_.IpAddress -eq $hostIp }).MACAddress
There is more detail at the site.
ASKER
This is close, but my posting explains what i'm trying to do, and this is still off by a bit.
ASKER
I'm suprised that finding such a script is such a problem. It seems that renumbering a large number of servers isn't all that uncommon, and considering that VMs are now so prevalent, you'd think that this scenario would be more common.
Amick,
Manually, I would just get all my IP's and then assign them to the new VM's, and then disable the old NIC's one by one as I assigned the new ones, but since our customer asked that it be scripted, I thought it would be relatively simple to find such a script since this doesn't seem that far outside the norm. I guess I was wrong, and since I know little about scripting and have no experience coding, I can't parse through the deeper aspects of a simple script like the one you mention above and reconfigure it to do something quite a bit more complex.
I have been to the links you mentioned. I crawled all over them yesterday, but like I said, i'm no scripter, so other than using one of the simple ones, I would have no clue as to what to do to build it further.
Thanks for you time.
Amick,
Manually, I would just get all my IP's and then assign them to the new VM's, and then disable the old NIC's one by one as I assigned the new ones, but since our customer asked that it be scripted, I thought it would be relatively simple to find such a script since this doesn't seem that far outside the norm. I guess I was wrong, and since I know little about scripting and have no experience coding, I can't parse through the deeper aspects of a simple script like the one you mention above and reconfigure it to do something quite a bit more complex.
I have been to the links you mentioned. I crawled all over them yesterday, but like I said, i'm no scripter, so other than using one of the simple ones, I would have no clue as to what to do to build it further.
Thanks for you time.
Open in new window
Rename Network Adapters to their MAC Addressesfrom: http://www.delltechcenter.com/page/Helpful+PowerShell+Scripts