LucD,
I am trying to run script as .cmd file for DR Servers to update the DNS while performing the DR.
Below is the script, which I am using.
Currently I am getting the below error
C:\DR>Powershell.exe -noprofile -executionpolicy bypass "&{start-process powershell -ArgumentList '-noprofile', '-verb r
unas', '-command " & {Get-DnsClientServerAddress | where {$_.ServerAddresses -contains 192.168.15.5} | Set-DnsClien
tServerAddress -ServerAddresses 192.168.5.100,192.168.5.101 -Verbose -Confirm:$false; ipconfig /flushdns; ipconfig /flus
hdns; Clear-DnsClientCache; Register-DnsClient}"' }"
The string is missing the terminator: '.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
'{Get-DnsClientServerAddress' is not recognized as an internal or external command,
operable program or batch file.