Closed BatisteDONDOGLIO closed 3 weeks ago
Hi @BatisteDONDOGLIO,
thanks for pointing that out. I will fix thex script next week after the Workplace Ninja Summit.
Best Ugur
Hi @BatisteDONDOGLIO,
Thanks again for the issue report! I’ve implemented your recommendations in version 2.4, along with some new features.
Best, Ugur
Hi @ugurkocde !
I hope you are well :)
I noticed a small issue happening when trying to check Users assignments (option 1), in case the user doesn't exists (not found).
PowerShell throws an error because it is not handled by the script itself. The script also attempts to continue checking for groups that user belongs to, despite the user not existing. Which obviously also fails.
This occurs here: https://github.com/ugurkocde/IntuneAssignmentChecker/blob/3ca0448875c6ded317d8accfc09352c42476fabc/IntuneAssignmentChecker_v2.ps1#L265
I've added a simple fix locally on the script by adding something like this:
This catches the 404 Not Found error and displays a simple error message accordingly, and catches all over responses and displays only their content.
I don't know if this is desired, and I'm sure it can be improved (for example, by adding more if statements to handle more errors, in case the
Invoke-MgGraphRequest
fails entirely?). But as a quick fix, it gets the job done.It also calls
continue
meaning it won't try to check the group assigned to the user that wasn't found and skips to the next user in the loop (if applicable).I'm sorry again for not submitting a pull request for this!
Greetings from France :)