Hello,
First post, hopefully I will do it right
I have a test environment on my workstation, running VMware Workstation. I have a DC (Window Server 2012 R2), a client machine (Windows 8.1), and a few servers (Window Server 2012 R2). I want to be able to build some VM’s running Window Server, and configure them via DSC. Before doing anything without DSC though, I was planning on connecting remotely and configuring by doing something like this:
#configure $computername = $(read-host "Enter computer name") $ipaddress = $(read-host "Enter IP address") $prefix= $(read-host "Enter IP prefix (ie, 24)") $dns = $(read-host "Enter DNS server address") Invoke-command -computername $computername -credential $(get-credential) -scriptblock { Get-netIPinterface -addressfamily IPv4 -DHCP enabled -connectionstate Connected | Net-netipaddress -Ipaddress $ipaddress -prefixlength $prefix -addressfamily IPv4 ; Set-dnsclientserveraddress -serveraddress $dns ; Register-dnsclient } -indisconnectedsession
My problem isn’t the code, I main problem is that I can’t run an “invoke-command” to the newly built VM because I can only see them via IP. They are getting a DHCP request, but they are not authorised for DNS (because they are not in the domain). I know the DHCP lease is there because I can run:
{get-dhcpserverv4lease -scopeID 10.10.10.0 | select hostname, IPaddress, Leaseexpirytime -last 1 | ft -AutoSize}
and see the lease. But the DNS update is “pending”.
So, using powershell, how do I disable Secure Only updates on the DNS server? And/or, is there a better way of doing this? I can see the settings, but can’t figure out how to modify it.
Get-DnsServer | select * -Expand serverzone | select dynamicupdate