Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $keyFile = import-clixml "C:Usersdi203179DNS_Keykey.xml"
- $secretFile = import-clixml "C:Usersdi203179DNS_Keysecret.xml"
- $key = new-object -typename System.Management.Automation.PSCredential -
- argumentlist $keyFile.username, $keyFile.password
- $secret = new-object -typename System.Management.Automation.PSCredential -
- argumentlist $secretFile.username, $secretFile.password
- $tc='[{"data":"pdns13.domaincontrol.com","name":"@","ttl":3600,"type":"NS"},
- {"data":"pdns14.domaincontrol.com","name":"@","ttl":3600,"type":"NS"}]'
- # Event log settings
- $eventLog = "Application"
- $eventSource = "GoDaddyDNSMonitor"
- #check to see if event source exists, if not create one
- if (![System.Diagnostics.EventLog]::SourceExists($eventSource))
- {
- New-EventLog -LogName $eventLog -Source $eventSource
- }
- #Here is where my issue lies########################################
- $newConfig=C:Usersdi203179DocumentsCurlbincurl.exe -s -X GET -H
- "Authorization: sso-key $key`:$secret"
- https://api.godaddy.com/v1/domains/nhrmc.org/records/NS/@
- If ($tc -ne $newConfig)
- {
- $Message = "DNS Nameserver @ GoDaddy has changed to " + $newConfig + "
- Application Infrastructure On-call needs to be paged. Details are below."
- Write-EventLog -LogName $eventLog -Source $eventSource -EventID 20000 -
- EntryType Error -Message $Message
- echo "false"
- }
- else {
- echo "true"
- }
Add Comment
Please, Sign In to add comment