I’m writing a very simply PowerShell script to create a VPN Phonebook entry for all users on the computer, but I cannot figure out how to enable the option to register this connection’s addresses in DNS. Microsoft doesn’t include that as a switch with Add-VPNConnection, and I am stuck on how else to accomplish this. I really don’t want to simply create a phonebook file (PBK) and push it out. That is old school, and it will step on existing entries in the PBK file.
The closest I’ve come is the following:
Set-DNSClient -InterfaceAlias ‘VPN Name’ -RegisterThisConnectionsAddress:$True
That doesn’t really work, though, because the VPN must be connected. I think it is only temporary for that session, and it isn’t really updating the phonebook entry.
Any ideas?