mirror of
https://github.com/jbowdre/vRealize.git
synced 2024-12-03 13:42:17 +00:00
Update 01_delete_dns_record.js
This commit is contained in:
parent
653b66b042
commit
81162ccb49
1 changed files with 6 additions and 6 deletions
|
@ -6,12 +6,12 @@
|
|||
var hostname = inputProperties.resourceNames[0];
|
||||
var dnsDomain = inputProperties.customProperties.domain;
|
||||
var deleted = false;
|
||||
if (dnsHost_supportedDomains.indexOf(dnsDomain) >= 0) {
|
||||
if (dnsHost.supportedDomains.indexOf(dnsDomain) >= 0) {
|
||||
System.log("Attempting to remove DNS record for " + hostname + "...");
|
||||
var sshSession = new SSHSession(dnsHost_sshHost, dnsHost_sshUser);
|
||||
System.debug("Connecting to " + dnsHost_sshHost + "...");
|
||||
sshSession.connectWithPassword(dnsHost_sshPass);
|
||||
for each (var dnsServer in dnsHost_dnsServers) {
|
||||
var sshSession = new SSHSession(dnsHost.sshHost, dnsHost.sshUser);
|
||||
System.debug("Connecting to " + dnsHost.sshHost + "...");
|
||||
sshSession.connectWithPassword(dnsHost.sshPass);
|
||||
for each (var dnsServer in dnsHost.dnsServers) {
|
||||
if (deleted == false) {
|
||||
System.debug("Using DNS Server " + dnsServer + "...");
|
||||
var sshCommand = 'Remove-DnsServerResourceRecord -ComputerName ' + dnsServer + ' -Name ' + hostname + ' -ZoneName ' + dnsDomain + ' -RRType A -Force';
|
||||
|
@ -29,4 +29,4 @@ if (dnsHost_supportedDomains.indexOf(dnsDomain) >= 0) {
|
|||
}
|
||||
} else {
|
||||
System.log("No need to remove DNS records.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue