Oracle Cloud –

Spin instance from

ps1_sysnative

$DCip = “DCIP”

echo ” LIST & GET ETHERNET INTERFACE” > c:\cloudinit.log
$ETH = Get-NetIPInterface -AddressFamily IPv4 | Out-String -Stream | Select-String “Ethernet”
echo $ETH >> c:\cloudinit.log
echo “REMOVE FIRST BLANK LINE” >> c:\cloudinit.log
$ETH = $ETH -replace [Environment]::NewLine,””;
echo $ETH >> c:\cloudinit.log
echo “GET THE ETHERNET ID” >> c:\cloudinit.log
$ETH = $ETH.substring(0,2)
echo $ETH >> c:\cloudinit.log
echo “SET DNS ENTRY USING DC” >> c:\cloudinit.log
Set-DnsClientServerAddress -InterfaceIndex $ETH -ServerAddresses $DCip -PassThru >> c:\cloudinit.log
echo “CHECK CONFIG” >> c:\cloudinit.log
ipconfig /all | Select-String -Pattern “DNS” >> c:\cloudinit.log