PVS Target Device Update Script - Supplemental File, disableddnsregistration.ps1

20 Mar 2015

Our PVS servers are multi-homed with the Provisioning NIC on a seperate VLAN. Because of how our network is structured, our Provision NIC could register its DNS, but client computers would not be able to connect to it as it is a segregated network. This script sets the Provision NIC to NOT register to DNS.

```powershell $provNic=Get-WmiObject Win32_NetworkAdapter -filter 'netconnectionid ="Provision"' $prodNic=Get-WmiObject Win32_NetworkAdapter -filter 'netconnectionid ="Production"' $adapters=Get-WmiObject Win32_NetworkAdapterConfiguration -filter 'IPEnabled=TRUE' foreach($adapter in $adapters) { if ($prodNIC.name -eq $adapter.Description) { $adapter.SetDynamicDNSRegistration($true,$false) $adapter.DomainDNSRegistrationEnabled } if ($provNIC.name -eq $adapter.Description) { $adapter.SetDynamicDNSRegistration($false,$false) } ```