Guest User

Untitled

a guest
Jan 17th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. $keyFile = import-clixml "C:Usersdi203179DNS_Keykey.xml"
  2. $secretFile = import-clixml "C:Usersdi203179DNS_Keysecret.xml"
  3.  
  4. $key = new-object -typename System.Management.Automation.PSCredential -
  5. argumentlist $keyFile.username, $keyFile.password
  6. $secret = new-object -typename System.Management.Automation.PSCredential -
  7. argumentlist $secretFile.username, $secretFile.password
  8.  
  9.  
  10. $tc='[{"data":"pdns13.domaincontrol.com","name":"@","ttl":3600,"type":"NS"},
  11. {"data":"pdns14.domaincontrol.com","name":"@","ttl":3600,"type":"NS"}]'
  12.  
  13. # Event log settings
  14. $eventLog = "Application"
  15. $eventSource = "GoDaddyDNSMonitor"
  16.  
  17. #check to see if event source exists, if not create one
  18. if (![System.Diagnostics.EventLog]::SourceExists($eventSource))
  19. {
  20. New-EventLog -LogName $eventLog -Source $eventSource
  21.  
  22. }
  23.  
  24.  
  25.  
  26. #Here is where my issue lies########################################
  27. $newConfig=C:Usersdi203179DocumentsCurlbincurl.exe -s -X GET -H
  28. "Authorization: sso-key $key`:$secret"
  29. https://api.godaddy.com/v1/domains/nhrmc.org/records/NS/@
  30. If ($tc -ne $newConfig)
  31. {
  32. $Message = "DNS Nameserver @ GoDaddy has changed to " + $newConfig + "
  33. Application Infrastructure On-call needs to be paged. Details are below."
  34. Write-EventLog -LogName $eventLog -Source $eventSource -EventID 20000 -
  35. EntryType Error -Message $Message
  36. echo "false"
  37. }
  38. else {
  39.  
  40. echo "true"
  41. }
Add Comment
Please, Sign In to add comment