I have been working with the script found at http://gallery.technet.microsoft.com/scriptcenter/Deploy-a-domain-controller-2ab7d658 as a base for my azure deployments. I ran into a situation where if a VNetwork already had a DNS entry it wouldn't allow you to add another DNS entry. It would give an error similar to
Property 'DnsServersRef' cannot be found on this object. Make sure that it exists.
This happened at line 447 of the original script.
Line 447 looks like:
$dnsServersRefElement = $foundVirtualNetworkSite.DnsServersRef
I fixed the error by adding .node after $foundVirtualNetworkSite. Like this:
$dnsServersRefElement = $foundVirtualNetworkSite.Node.DnsServersRefI hope that this gets fixed in the original script or that my post helps someone in the future.