PowerShell script to set VM static IP address - multiple subscriptions

Hi,
I have set successfully static IP Address to all of my virtual machines until now (1 subscription) using Set-AzureStaticVNetIP
But now I have 2 Azure subscriptions. The virtual networks names are the same at both of the suscriptions.
The question is:
How to define the subscription to use when defining static IP addresses to VMs?
Thanks in advance!

Hi SCCMadmin09,
Considering that you have successfully set static IP Address to all of your virtual machines until now for one of the subscriptions :
Login to your Azure account with the command ; this time you should be entering your second subscription login credentials.
Add-AzureAccount
  Add-AzureAccount
  :    This will open a windows login dialog that will allow you to enter your credentials of the second subscription.
  Now you need to find the name of the subscription you created your virtual machines under. The command is:
Get-AzureSubscription
The output will give the Azure subscription information
Here in the example, Visual Studio Ultimate with MSDN a/c is used. The command to select this is:
Select-AzureSubscription 
: Select Azure Subscription: Enter your subscription name and then ENTER:
Eg : Visual Studio Ultimate with MSDN
 At this point you are connected to your subscription and can begin to work with the virtual machines created under it.
There are two parameters you will need to have:
ServiceName
= the name of your virtual machine. Example :
DTechHST-Test01
Name
= the same name you entered as the ServiceName
And finally the commands, there are three.
Get-AzureVM -ServiceName <your_vm_name> -Name <your_vm_name>
 Set-AzureStaticVNetIP -IPAddress "<your_new_ip_address>"
 Update-AzureVM
 Unfortunately, entering these commands one at a time fails. They must be strung together via “pipes”.
Get-AzureVM -ServiceName <your_vm_name> -Name <your_vm_name> | Set-AzureStaticVNetIP -IPAddress "<your_new_ip_address>"
| Update-AzureVM
 As an example:
Get-AzureVM -ServiceName HST-Test01 -Name HST-Test01 | Set-AzureStaticVNetIP -IPAddress "192.168.224.50"
| Update-AzureVM
 In the event that you need to remove an assigned IP address, use the following command structure.
Get-AzureVM -ServiceName 
<your_vm_name> -Name <your_vm_name> | Remove-AzureStaticVNetIP | Update-AzureVM
Hope this helps.
Regards,
Shirisha Paderu

Similar Messages

  • How to set a static IP address for deskjet 6940dt

    I have two HP laptops, both have WIN7, that keep losing the IP address for my 6940dt printer, each time power goes out to router.  I have an desktop PC connected to a NetGear router and RCA modem connected to Comcast cable internet.  I also have another desktop that connects wirelessly through the router....but this desktop never loses the printer IP address and I can't figure out why it doesn't and my laptops do. 
    I have had a fellow at the senior center computer club tell me that I need to set a Static IP address to make the laptops connect .  I don't know how to do this and I would need someone to explain it in a language that I can understand, like real basic.  I have searched the internet but the things I have found have been very complicated to understand. 
    Can anyone help me?
    This question was solved.
    View Solution.

    Ooops, sorry, I forgot that yours is a wired-only network printer.
    You are on the right track - just go to where you were and follow my directions - it all works the same with wired as it does wireless.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Setting up Static IP addresses

    In the FAQ entry for setting up static IP addresses, it says to set the "Preferred DNS server" to: 192.168.1.1
    Currently, mine is set to: 68.94.156.1
    with an Alternate DNS Server of: 68.94.157.1
    Now, I'm wondering, does the Prefered DNS [i]have[/i] to be 192.168.1.1 or will what I currently have work just as well? Also, am I supposed to have an Alternate DNS server, and if so, is what I currently have it set to fine? Lastly, do the DNS servers have to be different for each computer?
    Any help would be great. I'm hoping to try and re-setup my router tonight.

    Kind of off topic, but don't want to make a whole new thread...
    Currently, my home network is very messed up. Previously, we would lose connections upwards of 4 times a day.
    At first, we thought it was because our modem was getting old. So my dad bought a new modem. But when he finished hooking up the modem, we still couldn't connect to the net, so he plugged his comp directly into the modem instead.
    Now, in an attempt to get things working, I have reconnected the router, modem and computers to eachother. However, there is a problem. I can't access the router's setup page from my computer anymore. The lights on the router and modem indicate that:
    1. The modem is connected the net.
    2. The router is connected to the modem.
    3. 3 devices are plugged into the router.
    Now, I have two wired comps, 1 x-box and a wirless comp. and I am using the WRT54G router. I don't understand why this computer cannot connect to the router. I know it is just this comp, because the wireless one can access the router's setup page, although it still can't connect to the net.
    Could someone give me an idea as to what the problem is? The only thing I can think of is, maybe instead of running a cable from the router to the computer, I ran it from the printer to the computer (they are right next to eachother). But don't think printers even use ethernet cables.

  • Can a powershell script be set to run once an email had been received from a certain address?

    Hello,
    I'm trying to see if a PowerShell script can be made to run once an email has been received from a given email address or with a certain subject.
    I came across this
    http://dmitrysotnikov.wordpress.com/2008/05/08/execute-powershell-scripts-from-your-smartphone/
    but I have not been able to get this to the run the script, only the transcript part seems to load. I have tried all suggestions but no luck.
    Has anyone been able to do such a thing? or know how?

    It is not PowerShell. It is VBA.  You need to post questions about VBA in the VBA forum.
    ¯\_(ツ)_/¯

  • How to set a Static IP Address to a HP Photosmart Plus B209a-m?

    Like it says up in the subject, I need to know how to do this. I tried to do it by typing in the IP of the printer into a browser, but then I lost connectivity with it all together. If someone could help, that would be amazing!!
    Thanks in advance!
    TechGirl88

    First, let's see if your printer is actually connected to your network.
    - Print a Network Config Page from the front of the printer. Note the printer's IP address.  If it is 0.0.0.0 or 169.254.x.x then the printer is not connected.  You will have to re-connect it using the same method you did originally.
    Now that it is connected, this is how to set a static IP:
    - Type that IP address into a browser to reveal the printer's internal settings. (if this does not work, you likely have a firewall and/or security system blocking it - please advise).
    - Choose the Networking tab, then Wireless along the left side, then the IPv4 tab.
    - On this screen you want to set a Manual IP. You need to set an IP address outside the range that the router automatically sets (called the DHCP range). If you know what that is, set an IP outside that range but no higher than 254 (the last number in the address). If you do not know this, enter the current IP address.
    - Use 255.255.255.0 for the subnet (unless you know it is different, if so, use that)
    - Leave the gateway and DNS blank. Click 'Apply'
    Now, shut down the router and printer, start the router, wait, then start the printer.
    After this you may need to redo 'Add a Printer' using the new IP address.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Setting up static IP address for my D110

    I'm trying to setup a static IP address for my printer.  I'm able to access the printer and get into the Embedded Web Server.  After I change the settings and click apply, I get an error message that says:
    An error has occurred. (wipv4Page-400)Click "OK" to go back.
    The changes will not save.  Any suggestions as to how to apply the changes?

    Probably you are using Internet Explorer11, I have the same problem with that.
    When using Google Chrome it works well, I think with Intenet Explorer 10 too.

  • Powershell script for security groups and users for multiple share folders

    Hi scripting team,
    I need your help with powershell script for the below queries 
    1. List out the security groups for more than one server share path and output it to a file ( csv ) 
    For eg.
    If the are are two share paths 
    \\servername\foldermain\folder1
    \\servername\foldermain\folder2
    So I needs the list of security groups for each share path
    And the output needs to be under each any every path.
    2. Grab the users belongs to main security groups and it nested groups for more than one security group and listed the users under each and every group. No need to display nested groups. Just users belongs to main group and users under nested.
    Your teams help is much appreciated 
    Thank you.
    Thilochana kumararatne

    Hi Braham,
    Thanks for your quick reply.
    Are we able to do this on two stage method
    1. grab the security groups from the share paths
    if can grab the share path from a separate txt file than copying it to the <your path> location
    so i can modify the txt file
    once run the script
    if can the output like below to a CSV file
    \\servername\foldermain\folder1group 1group 2group 3\\servername\foldermain\folder2group 1group 2group 3then i know which groups belongs to which share paththen i can remove the duplicate groups and keep the common groups to grab the users belongs to itso with the second script same as the first copy the security groups to a txt file and the out put as below.what I needs is the users full name and the samaccount name ( user id )group 1user1user2user3
    group 2user1user2user3looking forward your help on thisThank you.Thilo

  • PowerShell Script for Setting the Welcome Page View of a document set

    Hi,
    We are using document set in the document library and we have created the separate view in the document set and it will show only particular metadata columns. We need to change from default view to another view. For this, we need to write the power shell
    script and update the document set welcome page view link in the document set template. Please let me know how we can get this.
    Thanks,
    Mylsamy

    Hey Mylsamy,
    welcome page view is stored in $contenttype.XmlDocuments. Here is how you can change the view using powershell:
    $web = Get-SPWeb "WEBURL"
    $list = $web.Lists["LISTNAME"]
    $contenttype = $list.ContentTypes["CONTENTYPENAME"]
    $viewid = $list.Views["VIEWNAME"].Id
    $xmldocs = $contenttype.XmlDocuments
    foreach($xmldoc in $xmldocs)
    if($xmldoc.Contains("WelcomePageView"))
    Write-Host "XML contains WPV"
    $newview = [XML] @"
    <wpv:WelcomePageView xmlns:wpv="http://schemas.microsoft.com/office/documentsets/welcomepageview" ViewId="$viewid" />
    $xmldocs.Delete("http://schemas.microsoft.com/office/documentsets/welcomepageview")
    $xmldocs.Add($newview)
    break;
    $contenttype.Update($updateChildren, $false)
    Write-Host "Welcome Page View updated at " $list.Title
    Regards,
    Alexander 

  • Powershell script to set custom attribute on mailuser returns WARNING: The command completed successfully but no settings of user have been modified.

    I am trying to write a script to enable a mailuser (I do know the difference between mailuser and mailbox) and set a custom attribute for that mailuser.  Every time I run the script I get "WARNING: The command completed successfully but no settings
    of <User DN> have been modified."  Both commands being invoked work when typed manually into the exchange management shell on the exchange server itself.  I am using the same administrator account in the script, and when I login to the
    exchange server to manually run the commands, so it shouldn't be a permission issue.  Here is my script so far.  If anyone can shed some light on what I'm doing wrong, I'd appreciate it.
    $excel = new-object -com excel.application
    $wb = $excel.workbooks.open("c:\temp\testmail8.xlsx")
    $ws = $wb.Worksheets.Item(1)
    $row = 1
    $s = New-PSSession -ConfigurationName microsoft.exchange -ConnectionUri http://<Exchange Server Name>/powershell -Credential [email protected]
    Do {
    $Email = $ws.Cells.Item($row, 1).Value()
    $Cat = $ws.Cells.Item($row, 2).Value()
    invoke-command -Session $s -ScriptBlock {Enable-MailUser -ExternalEmailAddress $($args[0][0] + "@domain.com") -Identity $($args[0][0])} -ArgumentList (,$Email, $Cat)
    invoke-command -Session $s -ScriptBlock {Set-MailUser -Identity $($args[0][0]) -CustomAttribute1 $($args[0][1])} -ArgumentList (,$Email, $Cat)
    $row++
         } While ($ws.Cells.Item($row,1).Value() -ne $null)
    $excel.quit    
    Exit-PSSession

    Hi,
    I'm not sure where is wrong in your script. If you want to get more help about the script troubleshooting, I recommand you to ask a question in Script Center forum for more professional answers:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    As a workaround, please directly create a mail user in EAC and set related custom attribute to have a try.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • How to set a static IP address on a Mac server?

    I am setting up a New Mac server for a mail sever and have resieved the MX record and IP address from the ISP and DNS providers. Now I am trying to set up the server to be seen on the out side, or even on the network. Is this all done in the Network confiruration by maually setting the IP and Sub Mask there? I have set it all up to what I think they should be but not having any luck. When I installed the server software I told it to be a stand alone server was that wrong. I will not be running DNS or any other services on this system only Mail.
    thanks

    You should enter the IP address/netmask, etc. during the first-time-boot setup. Changing it later can be a PITA, but it sounds like you did that.
    Setting 'standalone' shouldn't be an issue since that only relates to directory services.
    It sounds like the problem is a more basic connectivity issue.
    Have you verified that you have basic IP address connectivity? Can you ping the router address provided by your ISP? Can you ping remote sites outside your network? If that's not working you're not going to get much further.

  • WRE54G expander setting static ip address, then no internet?

    I have set a static ip address on my wired computer for the expander. I can access the setup page, but not the internet. So, I went and set my computer back to " obtain ip address automatically ". Now I can access internet, but not the expander set up page.  I would like to upgrade my firmware, but  need internet and setup page at same time to do this.
    I thought once you set up a specified ip address and added it to your gateway you could then access it anytime when you had the settings changed back  to " obtain an ip address automatically " ? 

    Download the firmware when you have Internet Access, you may download the firmware from here , once the firmware is downloaded you can set-up static ip address on your computer and access your range expander set-up page and upgrade it's firmware...Once the upgrade is done you should reset and re-configure your range expander...
    Make sure you have identical wireless settings on your Range Expander and your Wireless Router...Your Range Expander should be in the same subnet as that of your router...

  • ?? How to set up actiontec MI242wr rev F router to accomodate Static IP addresses, port forwarding?

    I just got a new Verizon/Actiontec replacement router and I want to configure 4 or 5 static IP addresses beginning at 192.168.1.201  and above.
    At this point, I have changed the DHCP range from 192.168.1.2 - 192.168.1.250, to  192.168.1.2 - 192.168.1.200, so that is now the DHCP pool.  That presumably leaves anything above 192.168.1.200 open for static IP assignments.
    a) So now  how do I create a Static IP reservation for a device? (what router screens should I use? do the device(s) that I want a static IP have to be connected?, etc.)
    b) Once I have the static IP address reserved/configured, how can I make the appropriate port forward rule(s) for the devices?  Specifically, I want to allow SSH connections to each of the static IP addresses/devices.
    (I tried this once but the router complained after I made the first port forwarding rule saying that it was already in use!?!? and I want to avoid this problem again).
    Thanks
    -J

    thanks for your suggestion.  I figured out what to do...I let each device receive an address by DHCP, and then in the router, I went to Advanced -> Connections, double clicked on the device to get more details and  set  the "Static Lease" check box.
    What this does is a address reservation for the device, but still configures it via DHCP.
    It would be nice if the router manual noted this small detail, that devices can be configured as having a static address 'reservation' that is administered by the DHCP service, OR, one can set a 'static IP address' by ensuring that the device address is outside of the DHCP pool. 

  • How to set and static ip_address for a Suse Linux box

    Hi.
    I've done the following to set an static ip address for my Suse 9 Linux box:
    - Take not of inet address value from ifconfig command. ie: (172.17.2.14)
    - Change this value in /etc/hosts for my linux box.
    Since Suse is configure by default to use DHCP for assigning dinamic ip_addresses i'm not sure whether will lastly be set as a static address. I've rebooted my box and it seems to be OK.
    Thanks in advance ...!

    /etc/hosts is not configuration file for ethernet interfaces.
    Configuration files for ethernet interfaces are stored in /etc/sysconfig/network directory.
    For example if you have eth0 device then configuretion for this device is stored in /etc/sysconfig/network/ifcfg-eth0 file.
    Important directives:
    DEVICE - interface (eth0)
    IPADDR - IP address of interface
    NETMASK - netmask
    BOOTPROTO - "static" for static configuration, dhcp for dynamic configuration via dhcp
    ONBOOT - activating interface during boot (yes/no) (yes - of course :-) )
    GATEWAY - default gateway
    So for example you want setup static IP (192.168.10.1 / 255.255.225.0) for eth0 interface.
    Edit the /etc/sysconfig/network/ifcfg-eth0 file and your configuration should be:
    DEVICE=eth0
    IPADDR=192.168.10.1
    NETMASK=255.255.255.0
    BOOTPROTO=static
    ONBOOT=yesThen you simply restart the nework using:
    /etc/init.d/network restartOR
    /sbin/ifdown eth0
    /sbinf/ifup eth0 OR
    ifconfig eth0 down
    ifconfig eth0 up

  • How to Configure a Blackfin Static IP Address

    I've read that the Blackfin lwip stack wants a DHCP server to assign it an IPaddress. I've proven that this works for me using a BF537 EZ-Kit.
    Now I'd like to configure an application with a static IP address so I can use a crossover cable between a computer and the EZKIT.
    I've seen a method to do this in the LWIP User Guide but this seems to apply only to projects built using Visual DSP.  Is there a method to set a static IP address from LabVIEW Embedded?  The LV "build specifications" properties dialog seems to indicate as such but it doesn't seem to work when I try it. If I disable DHCP my application doesn't work at all.

    Try these steps:
    1) Disconnect your computer from your network.
    2) Connect the crossover cable between your computer and the Blackfin EZ-Kit.
    3) Assign a static IP address to your computer. If you don't know how to do this, follow the directions at the following Microsoft Website:
    https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_tcpip_pro_manual...
    If you don't know what numbers to fill in while following the directions, use the following settings for your computer.
    IP Address: 10.0.0.1
    Net Mask: 255.255.255.0
    Gateway: 10.0.0.254
    4) Start LabVIEW and open your project.
    5) Configure LWIP to a static IP address. To do this, open the Build Spec dialog in LabVIEW and click on the TCP/IP tab. Enable lwIP and uncheck Use DHCP.  Fill in a IP address.
    If your computer is setup with the above settings, the following Build Spec Options can be used for LWIP:
    IP Address: 10.0.0.2
    Subnet Mask: 255.255.255.0
    Gateway: 10.0.0.254

  • Printer working Scanner not working after changing to a static ip address

    I have an HP 7500A wide format printer.  I recently added a second router at my house to extend my wifi signal.  After that, the printer kept dropping the network connection.  So I set a static ip address of 192.168.1.250 for the printer.  Now the network connection seems solid, but when I try to scan from the Scan3 software on my Mac, it says it cannot find the printer.  I have a MacPro running OS X 7.5.  Thanks for any help.  
    This question was solved.
    View Solution.

    Hi @Carpenter47 
    I am sorry to hear the issue is not yet resolved. Let's try something different. I have a feeling the issue might be related to the static IP address.  Please complete the following steps.
    From the Home screen on the printer control panel, touch the Right Arrow button () to display the second navigation screen.
    Touch the Network icon.
    Touch the Down Arrow () to select Restore Network Defaults, and then touch Yes to confirm that you want to restore the network defaults for the printer.
    Return to the second navigation screen, and then touch the Down Arrow to select Wireless.
    Touch the Down Arrow to select Wireless Radio, and then touch Off to turn off the wireless radio on the printer.
    Return to the Wireless Radio menu item, and then touch On to turn the wireless radio back on.
    Now put the printer back on the network using the steps below;
    On the printer control panel, touch the Right Arrow (), and then touch Network.
    Touch Wireless, touch Wireless Setup Wizard, and then touch OK.
    Touch the name of your network.
    If the list does not contain your network name, follow these steps to enter it manually:
    Touch Enter New Network Name (SSID).
    Enter your network name. Make sure that you type the uppercase (capital) and lowercase (small) letters exactly. Otherwise, the wireless connection will fail.
    When you finish entering the new network name, touch Done, and then touch OK.
    Touch Infrastructure, and then touch WEP encryption or WPA encryption.
    If you do not want to use encryption (a security password), touch No, my network does not use encryption.
    If prompted, enter the WEP or WPA key, touch Done, and then touch OK to confirm. The printer attempts to connect to the network.
    - Source for these wireless troubleshooting steps: Wireless & network section of the 7500a support page
    At this point, you should now be able to Browse devices in the Scan software and see the printer. I understand you created a static IP because of having a second router, but let's back peddle for a moment to see if we can get the scanning working again. Typically having a second router causes issues as the printer detects 2 access points and I guess you could say 'it gets confused, but we will see what happens with a automatic IP address and go from there.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

Maybe you are looking for

  • Swap Iphone 5 color with AppleCare+

    I bought a black Iphone 5 from Verizon (bad move on my part), which happened to have out of the box damage on it.  Verizon replaced it, the replacement phone was even worse so I kept the original.  Now Verizon is saying I'm outside of their 14-day po

  • Airport and WRT54G (LINKSYS)

    Does any use the Linksys WRT54G with thier Mac? I bought one knowing it wasn't Mac compatable because I was just going to use it to play my Xbox wireless, but wanted to get airport down the road. I have an iBook and just wanted to know if anyone used

  • Source System - Web Service (BW 7.0)

    Hi, I need some urgent help in the following topic.. I am using a Web Service source System to load Info in an ODS . I see that the DataSource cumulates in just one request the Information that I am pushing to the BW System... and the info stays ther

  • Trouble with logging into my router

    I'm running a MI424-WR rev f router and when I log into 192.168.1.1, I can enter the admin login name, but I cannot enter the password. For every letter I type, at least two characters appear. I used to be able to copy and past the password into the

  • Modification in PO_STANDARD_XSLFO.xsl

    Hi, I'm try to make a new PO_STANDARD_XSLFO.xsl. But i have a problem with a field HEADER_SHORT_TEXT. I have many spaces in the field. What is the construction rules ? Thank you in advance