Automation of the network change

I am writing a script to help with a few major network changes that I am in charge of. The script I'm writing should do the following things...

Connect through Mgmt Network2

Remove vmnic2 vSwitch0

Create vSwitch3

Add several exchanges to vSwitch3

To the bottom of the NIC on the network of Mgmt

Restart the network Mgmt

Sleep 60 seconds

Connect to Network2 Mgmt

Fix the vlanid on network Mgmt

Change the ip address of the network Mgmt vmk

So here's what I have so far... I don't think I'm on the right track, but I feel that I can not go about it the right way. I have also the problem create exchanges on vSwitch3. Any help is greatly appreciated!

SE connect-VIServer-Server xx.xx.xx.xx

$VMhost = get-VMHost-name xx.xx.xx.xx

$vmnic0 = "vmnic0".

$vmnic1 = "vmnic1.

$vmnic2 = "vmnic2.

$vmnic3 = "vmnic3".

$VMhostMgmt2 = get-VMHost-name xx.xx.xx.xx

$vSwitch3 = "vSwitch3".

$VMhost | Get-VirtualSwitch | Where-Object {$_.} Name - eq "vSwitch0" - and $_. NIC - eq "vmnic2"} | {Foreach}

If ($VMHost |) Get-VirtualSwitch-Name $_. {Name)

Get-VirtualSwitch-Name $_. Name | Game-VirtualSwitch - Nic $vmnic0, $vmnic1 - confirm: $false

}

}

$VMhost | Get-VirtualSwitch | Where-Object {$_.} Name - not "vSwitch3"} | {Foreach}

If ($VMHost |) Get-VirtualSwitch-Name $_. {Name)

New-VirtualSwitch - VMHost $VMhost - name vSwitch3 - NumPorts 128 - Mtu 1500 - Nic $vmnic2, $vmnic3 - confirm: $false

New-VirtualPortGroup-name xx.xx.xx.xx - VirtualSwitch $vSwitch3 - VLanId 10 - confirm: $false

New-VirtualPortGroup-name xx.xx.xx.xx - VirtualSwitch $vSwitch3 - VLanId 12 - confirm: $false

New-VirtualPortGroup-name xx.xx.xx.xx - VirtualSwitch $vSwitch3 VLanId - 40 - confirm: $false

}

}

Get-EsxCli - vmhost $VMhost

$esxcli.network.nic.down ($vmnic0)

$esxcli.network.nic.down ($vmnic1)

Get-VMHostService - VMHost $VMhost | where {$_.} Key - eq "vpxa"} | Restart-VMHostService-confirm: $false

Start-sleep - s 60

to connect-VIServer-Server xx.xx.xx.xx

Start-sleep - s 60

$VMhostMgmt2 | Get-VirtualSwitch | Where-Object {$_.} Name - eq "vSwitch0"} | {foreach}

If (Get-VirtualSwitch-name $_.) {Name)

Game-VirtualPortGroup-name 'Network management' - VLanId 19 - confirm: $false

}

}

Get-VMHostNetworkAdapter | where {$_.} Name - eq "vmk0"} | {foreach}

If (Get-VMHostNetworkAdapter - VMHost $VMhostMgmt2-Name $_.) {Name)

Get-VMHost $VMhostMgmt2 | Get-VMHostNetworkAdapter-Name $_. Name | Game-VMHostNetworkAdapter - IP xx.xx.xx.xx - netmask 255.255.255.0 - confirm: $false

}

}

Get-VMHostService - VMHost $VMhostMgmt2 | where {$_.} Key - eq "vpxa"} | Restart-VMHostService-confirm: $false

Get-EsxCli - vmhost $VMhost

$esxcli.network.nic.up ($vmnic0)

$esxcli.network.nic.up ($vmnic1)

Get-VMHostService - VMHost $VMhost | where {$_.} Key - eq "vpxa"} | Restart-VMHostService-confirm: $false

It seems that you may have more than one open connection.

Display the contents of

Global $: DefaultVIServers

If there is more than one return value, and if you are working in "multiple" (see Set-PowerCLiConfiguration), which is probably the cause of the error

Tags: VMware

Similar Questions

  • Photosmart b209a more: how to change the network settings?

    I have this printer on a wireless network connection. In a few weeks will change my broadband service, which is to get a new router. Is there an easy way to change the network settings for this printer to connect to the new router, without having to reinstall the printer software?

    Here's what you need, your support page.

    http://support.HP.com/us-en/product/HP-Photosmart-plus-all-in-one-printer-series---B2/3777155/model/3777156/drivers

  • Network discovery, file sharing settings keep changing by itself and Alltel to set the network location continues to ask the wireless device

    former title: network location settings. Discovery of NW. File sharing. public folder sharing. AVG 9.0 'tools' and network connections.

    My Alltel Wireless device again set the network location. And continues to change my network settings for the discovery of NW to:, as well as file sharing for: file public and sharing: read-only.  I have AVG Security 9.0 and under 'tools' and connections network shows several svchost with States reading service connections listening and unknown. I don't want no access to my computer and cannot find any computer consultants who can get this to stop. What can I do?

    Hello
     
    1. the options apply automatically on?
    2. have you made changes on the computer recently?
    3. have you installed any Alltel Wireless application to manage network connections?
    4. What is the current network location type on? Is it home, work or public?
    Network discovery and file sharing settings depend on the network location. For examle, if you set the network as a public location it turn on file sharing.  So I would ask you to turn all the parameters and then choose the type of network and check if the parameters change again.

    Method 1.
    I recommend you to check if the problem exists in clean boot. May be a third party application is causing these changes.
    See the article below for instructions on how to start your computer in a clean boot state.
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135
    Note: When the diagnosis is complete, don't forget to reset your computer to normal startup. Follow step 7 in the above article.
     
    Method 2.
    Also check the settings under tools in AVG security suite. You may need to check with the help of AVG on it.
    Or you can disable the antivirus software and check if that causes this behavior.
    Temporarily disable the security software installed on the computer and check if the problem persists.
    Disable the anti-virus software
    http://Windows.Microsoft.com/en-us/Windows7/disable-antivirus-software
    Important note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • E3000 change the network name of the client

    When I configured everything first the E3000 I called CiscoRouter device, and I got:

    (a) CiscoRouter

    (b) CiscoRouter-comments

    I then decided to change the name of the device for: Alberto-network and now I have:

    (a) Alberto Network

    (b) CiscoRouter-comments

    I have not foud a way to change the name of the connection of comments.

    Cisco COnnect allows me to change the password for the network comments, but not the name.

    How can I change the name of the connection of comments?

    Alberto smell, MD

    As dalime said, you must set the name of the router and then the guest account is generated on that basis.  But it's a bit stupid.  If you have configured your router from the web panel name or after you set up your guest account, it will generate a generic name of Cisco.

    Solution:

    (1) disable comments

    (2) change the name of the router (as dalime has shown)

    (3) (cancel) the stupid usb key exchange request

    (4) change the name of the router to what it should be

    (5) (cancel) the stupid usb key exchange request

    (6) turn on comments and now he will recognize the name of the OK to add router "-guest" at the end of

  • Bluetooth decreases when the network signal changes

    Hello guys,.

    Since the last update (23.5.A.1.291) my bluetooth devices (headphones, speakers, etc. I've tried several) are not functioning normally. Bluetooth keeps disconnecting and then reconnect. I thought it was random at first, then I thought it was when my network signal was change, for example when it goes from 4G to 3G, it disconnects (even when the network signal is also 2 bars 3).

    You have a solution, this is done on my nerves...

    Thank you

    Concerning

    I made this https://www.reddit.com/r/SonyXperia/comments/2mdmuk/getting_throw_function_to_workalternative/ and it worked.

  • The network ID Wizard will not change to "this is a home computer: this isn't a part of a business network!

    When I click on network ID is preset at "computer is part of a business network."

    I want to choose "this is a home computer: is not part of a business network!" that I chose, and then say next and finish, restart the computer

    Just after the restart, he ignored the change and always says 'the computer is part of a business network. "

    I tried this change now on at least 10 occasions but without success.

    Help!

    Hello

    Did you of recent changes made to your computer?

    I suggest you follow the link and check.

    Temporarily disable the antivirus on the computer running software and check if you are able to install the software.

    Disable the anti-virus software

    http://Windows.Microsoft.com/en-us/Windows-Vista/disable-antivirus-software

    WARNING: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    Also I suggest to restart the computer and try to change the network ID and check.

    I also suggest you to follow the link and check.

    Networking of computers running different versions of Windows

    http://Windows.Microsoft.com/en-us/Windows-Vista/Networking-home-computers-running-different-versions-of-Windows

  • Help to change the network settings on the guest account

    On my internet guest account worked very well, is not working anylonger. I tried the administrator account to change network settings, the guest account, but the only option I have is to change the image and to deactivate the account.

    Can someone help me please?

    Thank you.

    Hello
     

    1. What are the changes that you made before the show?
    2. what happens when you try to access the Internet?
    3. were you able to access the Internet with your admin account?
    4. do you have an error message?

    Method 1:
    I suggest you do the networking in safe mode
    http://Windows.Microsoft.com/en-us/Windows-Vista/advanced-startup-options-including-safe-mode

    Method 2:
    I also suggest you to return the item.
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-Internet-connection-problems

    Method 3:
    Follow these steps:
    a. create a new user account and see if the problem occurs in the newly created account.
    b. If the problem does not persist in the new user account, it may indicate that your old user account is corrupted.
    Access the link below and follow the steps to repair the corrupted user profile:
    Difficulty of a corrupted user profile

  • change the name of the computer on the network from a PC ToshibaUser

    I want to change the name that appears on the network after installation of vista to stop reading ToshibaUser-PC

    Hello

    These should help:

    Definition of name computer and workgroup in Windows Vista
    http://www.home-network-help.com/setting-computer-name.html

    Change your computer name in Windows 7 or Vista
    http://www.howtogeek.com/HOWTO/Windows-Vista/change-your-computer-name-in-Windows-Vista/

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • HP 200 MFP M276nw not seen in the network after changing router

    Printer: LaserJet Pro 200 color MFP M276nw

    LAN: both PC (Windows 7) and the printer connected to the router.  Other devices connect wirelessly.  Internet service is cable.

    I installed this printer when a router Linksys E2500 was in use.  The configuration of the network after the installation of the printer:

    IPv4 address: 192.168.1.120

    Subnet mask: 255.255.255.0

    Default gateway: 192.168.1.1

    Configured by IP: DHCP

    I replaced the router Linksys with a Netgear WNDR4500 router (N900) a month ago.  Everything worked fine for about two weeks.  All of a sudden, jobs sent to the printer began to take a long time to start to print until they stopped printing altogether.  The printer does not appear as a device plugged (cable) in the interface of the router on the Web.  Not even the HP Print or HP Print software and the Scan doctor could find a printer is connected.

    I have unisntalled and reinstall the printer, but did not succeed until I changed the Ethernet cable connecting the printer to the router.  The difference is that the old cable Cat5e and replacement a Cat6?  It's printing and scanning now but the printer is still absent as a wired device, and I fear that it will stop working once more.

    I noticed that the network configuration of the printer after reinstalling is:

    IPv4 address: 169.254.230.140

    Subnet mask: 255.255.0.0

    Default gateway: 169.254.230.140

    Configured by IP: AUTOIP

    Research on the Web, I found an article saying that AUTOIP could be a sign of problems of router or a cable.  My suspicion is that the IP address of the printer is constantly changing and this is the reason for the delay of printing.

    My questions to the experts are: I could assign an IP address to the printer manually so I can add it in the router - it provides to this effect- and how this is done?   In the Toolbox of device HP under the IPv4 Configuration, there is a dropdown menu with different options - DHCP, BOOTP, AUTOIP, and manual, but I don't know if the changes are made here or if it's a more complex undertaking.

    Thank you very much.

    Kind regards

    Miguel remainder

    I solved the problem, the same day I posted the request for help.

    I've closed everything down - including the cable modem and router - but left the printer.  Go to the printer control panel and changed is manual configuration IPv4 of AutoIP toe.  I had already selected an IP starting with 192, since I read that starting with 169 IP addresses are associated parameters AutoIP.  From there on, the printer has presented a valid subnet mask addresses, I took one, and a default gateway address.  Then I stopped the printer.

    I turned on the modem, router, pc and printer.  The router then showed the printer as a device connected with his newly assigned IP address.

    I figured that the cable was not a problem here, so I put the Ethernet Cat5e cable.  What baffles me, is why the printer changed to AutoIP because it was not made by any user.  Check the reports printed during the first installation of the printer, I see that the method of IP in DHCP address.  After putting in the new router, changes were to name SSID and password in wireless devices and found the firmware of the router.

    It was learning by trial as I'm not a computer expert, but so far, we print and scan documents.

    Thanks to all who took the time to read the post and offered help.

  • Change the name of the network printer wireless

    We have several Officejet Pro 8600 in our building.  We are printing wireless on their part and need to change the name of the printers so that we know who is who.  How can I change the name of the network to a printer?

    You can RIGHT CLICK on the printer in PRINTERS AND DEVICES. There will be a tab RENAME you can choose to change the name.

    You will have to do it on EVERY COMPUTER in the building. The printer itself has a HOST name and is the name of the NETWORK.

    It's about the only way that you can change the name of the printers.

    I hope this helps.

  • How can I add or change the network I had for the TouchPad?

    Most of the devices on a network have names for the device for one reason or another. This allows to distinguish between connected devices and the legitimacy of it.

    So far, I was unable to add a network ID to this TouchPad.

    With the Amazon Kindle fire had seen the network ID as 'My Phone' that I really want to change, and fast. Haven't managed to change with an Android app called Fing, which enabled me to use an unorthodox network identification name.

    I would like to find another network utility which can do the same for the HP TouchPad. Any ideas about a utility or more manual method? FING via Kindle fire shows no network for my TouchPad ID.

    Hello Xelkos,

    What you're talking about is actually a function of DHCP. If you request an IP address, a client can send a hostname on the server so that it can be easily identified in a readable way.

    By default, this is disabled on the TouchPad. To enable it, you'll need to edit a text file on the device. There are many different ways to do this, so pick your favorite and follow these insturctions.

    1. Find /etc/dhclient.conf and open
    2. Find the line that begins with:
      # send-hostname
      
    3. Delete the "#" sign in the front of the line and change the text inside the quotation marks. This text should be what you want as your host name to be:
      send-hostname "TouchPad"
      
    4. Once you have finished, save and close the file
    5. Turn Wi - Fi off and then turn it back on. You should now see your name appear on your Access Point / router.

    NOTE: Do not forget that in order to make these changes permanent, you must set the file read-write system:

    mount -o remount,rw /
    

    You must also set this back to read-only when you are finished:

    mount -o remount,ro /
    
  • Change the computer name in the network discovery, view old and new names and get error code 0 x 80070035

    I changed the computer names of computers each with windows 7 and a home network sharing. Network discovered each poster now the old and new names. I also have an error code 0 x 80070035.

    How can I get rid of the old names?

    Hello

    Are you able to access computers using the names?

    Step 1: Check out the link to learn how to delete the old name and create a new name:

    Change the name of your computer:

    http://Windows.Microsoft.com/en-us/Windows7/change-your-computer-name

    Step 2: Refer to the section below for more information to correct the error 0 x 80070035 and steps.

    Open the homegroup troubleshooting utility

    http://Windows.Microsoft.com/en-us/Windows7/open-the-HomeGroup-Troubleshooter

    Error 0 x 80070035 appears if you are not able to access the network computer. Follow the instructions in the thread below if you are faced with a similar question:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/Windows-7-error-0x80070035-when-trying-to-share/d8168c72-D51C-41C3-8B8F-3b6bb7f65f43

    It will be useful.

  • Impossible to change the network name to an existing network

    During a recent upgrade of windows 7 to 10 the procedure at about 80% and froze with the error 8007002C - 4000D. Windows 10 not able to complete its update, the system proceeded to reinstall windows 7. Once this is finished, I found that he had lost access to internet, ipconfig address had been changed and a new unidentified network had been set up, which I'm unable to edit or delete. After spending 2 days trying to get this PC to normal with 7. I tried the 10 upgrade again, but with the same result. I can't figure out how to get my PC to Windows 7 because I don't know how I've changed the name of the network in the first problem.

    To explain my network configuration of the PC with the problem Desktop which is Ethernet is connected to a router with 3 laptops wireless and a wireless printer. Laptop computer and printer seem to work fine, and the Office can see these devices but cannot connect to the internet or a network.

    I fixed the IP address of the desktop computer and tried everything I can think but cannot add this PC to your existing network.

    Why Windows 10 cause this problem that I'm not sure, but my main concern right now is to get this PC to its previous state.

    You would be extremely grateful if anyone could offer some advice.

    Thank you

    Fortunately, I managed to solve the above problem.

    After contacting my antivirus software company to find out if one of their customers had the same problem and the reception not good answers. I found another forum that advised people to uninstall the antivirus software and disconnect all external devices such as hard drives external, printers etc.

    After following these tips Windows 10 downloaded and installed without any problems.

    Hope this helps other people with the same problems.

    Thank you

  • Home LAN in the network as 'Unidentified network' and position the 'Public' profile in black - cannot be changed.

    I have two systems running W/7 Home Premium - in both LAN I setup for my home network is presented as 'Unidentified network' and is set to the 'Public Profile ' represented in black, which can not be changed. I cam change the name of the local network that is displayed correctly, but nothing else. I tried to use just the TCP/IP 4 and setting static IP addresses, who worked on these systems using Vista, without success. I tried to use TCP/IP 4 and 6 without setting static IP addresses - again without success. Looking at the forum for discussions on what I have not been able to find a solution to the problem. There are two systems.

    MJMathews

    I fixed it after many hours. Here is my situation and my workaround. It will be useful.

    At home, I have 2 internet broadband connections. One is ADSL (20 Mbps) behind a router with DHCP and the second is cable (120 Mbps) directly behind the modem (public IP to the computer). Both lines go to my Mediacenter PC that is always on and running the Kerio control (https://www.kerio.nl/products/control/). Kerio is a router function software that supports the binding switch. As you can see, having a working internet connection is essential for me. A third network interface card is configured with a static IP (192.168.3.1), Kerio is running a DHCP server on it and is connected to my home network.

    I did two things, but I think the real trick is the second. Anyway, the first step was that I ran the Powershell script mentioned in the http://blogs.msdn.com/b/dimeby8/archive/2009/06/10/change-unidentified-network-from-public-to-work-in-windows-7.aspx . Works on all networks unidentified to the networks work. Well, not either but the Group residential don't start on work networks!

    Windows 7 detects your home network by looking at its front door. Because I was running router/gateway on the same PC, I don't fill out the IP Address of the gateway. So, he won't give the popup to identify the network and you won't be able to put it manually at home. Also, I forgot to do it in the script.

    Setting of the gateway to the static IP address also did not work because Windows deletes the address of the gateway (192.168.3.1) after pressing OK. My Tip: Add a second IP address for the network card. For example 192.168.3.254. Then leave the main IP (in my case 192.168.3.1) and set the IP of the gateway to the second IP (192.168.3.254). A few seconds later, Windows will address the context menu and select "Home network" and you're done!

  • [Issue] Is it possible to change the order of connection of the network through the powershell command or back?

    Hello my dear

    I would like to ask how to change the binding of the network through the powershell command or back order.

    I know it could be changed as below.

    http://Windows.Microsoft.com/en-GB/Windows/change-network-protocol-bindings-order#1TC=Windows-7

    but I want to change it via text command. Because sometimes, I change it many servers via GUI and then happened a long time depending on the amount of servers.

    If it can be modified it using the command text, or registry, it will be useful for me.

    Thank you.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)

Maybe you are looking for

  • Windows on Ideapad Y510P ExpressCache question - gel Constant 8.1

    Hello I recently bought the laptop Y510p and updated to 8.1 windows Since the upgrade, I'm telling gel, which could last 10seconds or 10 minutes. Any time I restart the computer, it crashes, and the only way to kill him is to press the button works /

  • Why does the music on my laptop its funny when I play

    When I play music on bearshare, Windows media player or you tube, it sounds funny.what I can do to fix this?

  • Cartridge HP 970-971 (ink pigment or dye)

    HP Officejet printers have XPro 551. We use ink or dye must use pigment ink in the printer cartridge? Is - this inconvenient to use Dye ink?

  • window8 internet connectivity problem

    Hello Desription computer hp laptop pavilion m4-1003tx I use window 8 and my laptop does not connect to internet. If I use the security key correct just show "cannot connect to this network. Please help me solve this problem.

  • Article questions

    We use the API with the default template (blue article) to download a few items, but all the pictures of the items do not appear.Do you know what could happen?