Created
July 27, 2017 20:40
-
-
Save MatthewJDavis/85b93d15ef222f504524cc4d0aae033f to your computer and use it in GitHub Desktop.
Update the VNET DNS server settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # config settings - get DNS Server addresses from the portal under the AAD Domain Services blade | |
| $vnetName = 'northeurope-vnet' | |
| $vnetRg = 'domain-services-rg' | |
| $dnsServer1 = '10.0.0.4' | |
| $dnsServer2 = '10.0.0.5' | |
| $vnet = get-azurermvirtualnetwork -Name $vnetName -ResourceGroupName $vnetRg | |
| # Add the DNS Server values to the VNET var | |
| $vnet.DhcpOptions.DnsServers = $dnsServer1 | |
| $vnet.DhcpOptions.DnsServers += $dnsServer2 | |
| # set the DNS servers for the vnet | |
| Set-AzureRmVirtualNetwork -VirtualNetwork $vnet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment