We’ve all been there, you created that Bitlocker policy (other policies are available) years ago, it’s working fine, but you can’t remember which section you created it in.
You could click around in the portal until you find it, or you could run my latest script:
Install-Script -Name intune-findby-name
Also available on Github here
Simply run intune-findby-name.ps1 -name “App/Script/Policy/Whatever Name”
It will output:
The ID, URI and what it is:
As usual, there is a variable you can switch if you want to use an App Registration and run with automation, or just run manually from the command line.
You could use this to delete policies by calling a DELETE Graph command on the URI or just as a better search option.
It will also be added into the copy-policy script to be able to quickly copy by name rather than using the GUI
Enjoy!
Great! Thanks Andrew
That did work. But I was expecting something else. I was expecting something like “equals”. Now it is a requirement to know the exact name of the profile. If you know the exact name of the profile you could go via the portal instead.
Yes, but it’s designed to be used with automation scripts where going to the portal isn’t an option. If I get time, I’ll add the option to use wildcards in V2
Tried intune-findby-name.ps1 -name bitlocker and intune-findby-name.ps1 -name chrome.. But nothing. Any advice?
Is that the exact names of them? It’s an equals query, not a like query so it has to be precise
I’ve just .\intune-findby-name.ps1 -name “App/Script/Policy/Bitlocker/
But also tried .\intune-findby-name.ps1 -name “App/Script/Policy/Shared/
So if you have a bitlocker policy you would type -name “bitlocker policy”
Thanks for sharing this. I’ve installed this script and run this multiple times but every attempt results in:
Installing Microsoft Graph modules if required (current user scope)
Microsoft Graph Authentication Already Installed
Welcome To Microsoft Graph!
Nothing happens.
When I check the .log file there are a lot of Access Denieds, AccessDenied”,”message”:”You cannot perform the requested operation, required scopes are missing in the token etc. I ‘ve consent all the MS Graph permissions when asked for.
Hi, what was it you were searching for? It might need a scope adding