Update create-domain.ps1
Don't change DNS settings for azure provisioning
This commit is contained in:
@@ -46,10 +46,12 @@ if ((gwmi win32_computersystem).partofdomain -eq $false) {
|
|||||||
-Force:$true
|
-Force:$true
|
||||||
|
|
||||||
$newDNSServers = "127.0.0.1", "8.8.8.8", "4.4.4.4"
|
$newDNSServers = "127.0.0.1", "8.8.8.8", "4.4.4.4"
|
||||||
|
|
||||||
$adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object { $_.IPAddress -And ($_.IPAddress).StartsWith($subnet) }
|
$adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object { $_.IPAddress -And ($_.IPAddress).StartsWith($subnet) }
|
||||||
if ($adapters) {
|
if ($adapters) {
|
||||||
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting DNS"
|
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting DNS"
|
||||||
$adapters | ForEach-Object {$_.SetDNSServerSearchOrder($newDNSServers)}
|
# Don't do this in Azure. If the network adatper description contains "Hyper-V", this won't apply changes.
|
||||||
|
$adapters | ForEach-Object if (!($_.Description).Contains("Hyper-V")) {$_.SetDNSServerSearchOrder($newDNSServers)}
|
||||||
}
|
}
|
||||||
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting timezone to UTC"
|
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting timezone to UTC"
|
||||||
c:\windows\system32\tzutil.exe /s "UTC"
|
c:\windows\system32\tzutil.exe /s "UTC"
|
||||||
|
|||||||
Reference in New Issue
Block a user