below script, please let me know if missing something.
#script add dns 'a' records 'ptr' records dns servers $dns = "afidc1.xxxxxxx.com" # dns server name $zone = "xxxxxxx.com" # forward lookup zone name $ip = "x.x.x.x" $name = "pweb17s1" $localuser = "xxxxxx\mayigi01" $localpass = "xxxxxx" enter-pssession –computername $dns -guestcredential $localuser $localpass import-module dnsserver add-dnsserverresourcerecorda –computername $dns -name $name -ipv4address $ip -zonename $zone
below error facing:
enter-pssession : positional parameter cannot found accepts argument 'â€computername 'afidc1.xxxxx.com' -guestcredential xxxxx\mayigi01 xxxxx import-module dnsserver add-dnsserverresourcerecorda â€computername'. @ c:\users\devoops!\desktop\dns.ps1:9 char:1 + enter-pssession –computername 'afidc1.xxxxx.com' -guestcredential $localus ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : invalidargument: (:) [enter-pssession], parameterbindingexception + fullyqualifiederrorid : positionalparameternotfound,microsoft.powershell.commands.enterpssessioncommand
i used ise:
just copy here maybe?
#script add dns 'a' records 'ptr' records dns servers $dns = "afidc1.xxxxxxx.com" # dns server name $zone = "xxxxxxx.com" # forward lookup zone name $ip = "x.x.x.x" $name = "pweb17s1" $localuser = "xxxxxx\mayigi01" $localpass = "xxxxxx" enter-pssession -computername $dns -guestcredential $localuser $localpass import-module dnsserver add-dnsserverresourcerecorda –computername $dns -name $name -ipv4address $ip -zonename $zone
Comments
Post a Comment