Use PowerShell to Look Up IP Address Geolocation Data
Many Microsoft 365 and Exchange Server logs contain IP addresses. To find out where the IP addresses come from and if they are internal or external, PowerShell developers can use online web-based geolocation services. It's important not to overuse the services because you could be throttled.