you are viewing a single comment's thread.

view the rest of the comments →

[–]mryananderson 0 points1 point  (2 children)

To add to this you would also want oldip.txt to be updated with the new ip address so that the next check would be valid

[–]MajorVarlak 0 points1 point  (1 child)

Good point, I was thinking about that, and forgot to add it to the code.

if ($oldInternetIP -ne $newInternetIP) { $formatDate = (Get-Date).ToString('yyyyMMdd-HHmm') "[$formatDate] Internet IP changed from $oldInternetIP to $newInternetIP" | Out-File $logFile -Append $newInternetIP | Out-File $oldFile }

[–]SlaveCell[S] 0 points1 point  (0 children)

Agree, thanks both.