CRM 2015 – Advanced find to return all enabled users with a security role

I had a requirement to find all the users who had a security role because I needed to update a value.

Advanced find is easy to find

I am a big fan of the advanced find and have been known to have many open at the same time

Why the advanced find is a CRM Developers best friend

In CRM 2013 Microsoft made it difficult to find the Advanced (Why Microsoft why?).  I often had to think how to find the advanced find which is a big no no in UX design (Good CRM design should not make users think)

The bad treatment of the advanced find caused one CRM developer to create a solution which added the advanced find to every record

CRM 2013 Tool – Advanced Find on record forms for CRM 2013

Security Priviledges

If you have users who don’t have security roles you will see this (annoying) message

Advanced find users with security roles 1

The common reason for the message above is due to users being added and not yet given any security roles, which is usually because someone forget or they are being lazy

Other reasons for users having no security roles is moving users between business units.  When you move a user between business units it removes all the security roles.

Sometimes CRM admins can take away user roles from a user rather than disabling them.  The user won’t be able to do anything.   Remember a users security privileges can come from Team membership, not only their individual security roles.

If you want to learn more about users and security roles, read this brilliant article from CRM MVP Adam Vero

Security Roles and Teams in CRM – An Inconvenient Half-Truth

For a brief overview of security roles and business units

Business Units and Security Roles

a list of limitations and rules of CRM security read my exam notes


Creating the Advanced find

This advanced find was straight forward, I wanted to search the User entity for users who had security roles.

I selected user record, adding a condition to the security role where it contain data.

Advanced find users with security roles

Advanced find limitations

You cannot do Not in queries with advanced find.  If the requirement was to find all the users who didn’t have any security roles, this would have been impossible to do in advanced find.

Hopefully the Not query functionality will be added to Microsoft Dynamics CRM and the good news is there is a connect item we can vote up (it has over 600 votes)

Allow NOT IN searches in advanced find, marketing lists etc

The bad news is it has been an issue since 2011.  I have noticed a growing number of issues raised in connect, going through the channels Microsoft recommends and the issues not being fixed.

In the blog post Is Microsoft Listening to the Dynamics CRM Community? I suggest Microsoft should revamp the connect system and process so they can utilize the feedback generated by the CRM community to improve Microsoft Dynamics CRM.  At the moment I feel the Connect website and process is to slow and isn’t working.

If you need the functionality now I have seen two customizations you can try using

Building “Not In” Queries Using Dynamics CRM Advanced Find

Performing Outer Join in Advanced Find






27 thoughts on “CRM 2015 – Advanced find to return all enabled users with a security role

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.