Quantcast
Channel: Microsoft Intune
Viewing all articles
Browse latest Browse all 1216

Script to delete certain registry keys

$
0
0

So, I am trying to setup/test Intune and I ended up delete some PCs. To add these PCs back into Intune it required to remove registry keys before Intune will enroll them back in. I am going to remove all the PCs that are currently already intune to start fresh however I am trying to determine the best way to delete all the keys using a script instead of doing it manually on each PC.

The problem is I need to delete all the keys from this path:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Enrollments that are the generated keys that have the "18DCFFD4-37D6-4BC6-87E0-4266FDBB8E49" values for example and leave all the rest as is.

Would this be possible with powershell? I did find a way to delete all the keys or keys by a certain name but nothing about deleting all of them except for ones with certain names.

Thanks for any help,

Eddie


Viewing all articles
Browse latest Browse all 1216

Trending Articles