Incomplete Defender for Endpoint API call via Powershell
Hello!
I'm trying to export data from my assets via Powershell, using this api:
https://api.securitycenter.microsoft.com/api/machines
My script seems to be working fine but unfortunately the JSON-Response doesn't contain all the IP-Addresses displayed in the defender for endpoint portal for each device. Certain addresses are missing. Is there any reason or explanation for that?
Also when using this API to access the data for one device:
https://api.securitycenter.microsoft.com/api/machines/{id}
the response is always null, although the inserted id is correct and the script is the same that works for all machines. When adding vulnerabilities to the same URI: https://api.securitycenter.microsoft.com/api/machines/{id}/vulnerabilities the API endpoint works again.
Has anyone experienced anything like this before?
Thanks in advance for any hints or ideas on what I could be doing wrong! 🙂
This is my Powershell script: