Forum Discussion
neilcarden
May 21, 2020Brass Contributor
Remove devices from MDATP portal
We have a couple of devices that are showing in MDATP which we would like to get rid of, however we are not in a position to run any scripts... One was registered in InTune by mistake and has been u...
- May 29, 2020
neilcarden Sorry for the confusion, it's poorly labeled in ATP. Here is a screenshot of what it should look like before you run the query (it looks like you're entering the comment in the bottom "Response body" when it should be the top unlabeled input box):
Thank you,
Kate
KateAWin
May 26, 2020Brass Contributor
Hello
I have ran into this issue previously and found a great fix that doesn't involve contacting the users or even having physical access to their machine. Please follow these steps:
- Copy the machine you want to offboard in the machine list and obtain the machine ID from the URL (…/machines/<machine ID>)
- Navigate to API explorer (Left pane in ATP > Partners & APIs > API explorer)
- Change first drop-down to "POST"
- Paste this URL (https://api.securitycenter.windows.com/api/machines/{machine-id}/offboard)
- Enter machine ID in the URL (keep the entire URL, just replace <MachineID>)
- Run query (This will force machine to run the offboarding script next time the machine checks in.)
- Include this comment (remove the first and last quotations):
"{
"Comment": "Offboard machine by automation"
}"
8. Repeat 1-6 for each machine you'd like to remove
Hope that helps!
Thanks,
Kate
- George SimosApr 03, 2023Copper ContributorThat's very good to know, however it requires that the device is online and the offboarding can kick in. If the device is not online (e.g. decommissioned), then I guess we have to wait until it gets removed after the retention period expires for it right?
- Groove200Apr 19, 2023Brass ContributorCorrect. It will tidy itself up when retention expires.
I initially questioned this as I like things clean, however when the reason was explained, ie if there is a mechanism to manually remove stuff from Defender, then there is an attack surface that can leverage that mechanism and that would be bad times. Id rather have it this way than some bad actor removing everything 😉
- Thijs LecomteDec 11, 2020Bronze ContributorYou are using it on an unsupported platform.
From the docs:
This API is supported on Windows 10, version 1703 and later, or Windows Server 2019 and later. This API is not supported on MacOS or Linux devices.
https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/offboard-machine-api
- neilcardenMay 26, 2020Brass Contributor
KateAWin Thanks for your response... I have tried this on two machines... and get the following error
{"error": {"code": "InvalidRequestBody","message": "Request body is incorrect","target": "a66d6701-05de-45ea-xxxx-439235eec2cf"}}Google search doesn't return much in way of help- KateAWinMay 27, 2020Brass Contributor
neilcarden In order to post the HTML on this web page, I had to include quotation marks before and after the brackets: "{}"
Remove only those two quotation marks, but keep the rest of the code. Also, you can give it a try without entering anything in the body. I would assuming the comment is optional, though I've never tried it myself.
Thank you,
Kate
- neilcardenMay 29, 2020Brass Contributor
KateAWin Thanks again for responding however I am a bit confused.
So I am running this query (not real machine id)
https://api.securitycenter.windows.com/api/machines/aaf12345677955b102547d22ff302/offboard
Do I need { } either side of the machine ID?
And where do I type the comments bit??
I have attached a pic.