ModernAndSecureWorkplace icon indicating copy to clipboard operation
ModernAndSecureWorkplace copied to clipboard

Invoke-IntuneCleanup script broken

Open twyrick1971 opened this issue 1 year ago • 1 comments

Hello!

Just wanted to note that as a sysadmin, I was in need of a script to remove duplicate serial number entries from our Windows Devices list in InTune, and a search for a solution landed me here with the Invoke-IntuneCleanup script posted.

Unfortunately, it relies on the MSGraph API (Connect-MSGraph), which it seems Microsoft has replaced as of July, 2024 with Connect-MGGraph. This replacement doesn't seem to support any of the same commands for interacting with InTune?

twyrick1971 avatar Oct 29 '24 22:10 twyrick1971

The module also supports Intune but I would need to rewrite the whole script and this is currently not onnthe roadmap. But you can use my script as an idea and rebuild with the new module.

ThomasKur avatar Oct 30 '24 06:10 ThomasKur

@twyrick1971 I created a PR here for using MgGraph. Feel free to use that code, they were pretty minor changes. I tested it a bit with -WhatIf but have not used this in production (I never used the script with MSGraph, so use with caution).

arrrghhh avatar Feb 18 '25 20:02 arrrghhh

Thanks, I have now merged it to the main branch

ThomasKur avatar Mar 22 '25 16:03 ThomasKur