How to fetch Users with Security roles using fetch xml

securityroleswithusername

<fetch mapping=”logical” count=”50″ version=”1.0″ >
<entity name=”systemuser” >
<attribute name=”fullname” />
<link-entity name=”systemuserroles” from=”systemuserid” to=”systemuserid” >
<link-entity name=”role” from=”roleid” to=”roleid” >
<attribute name=”name” />
<attribute name=”roleid” />
</link-entity>
</link-entity>
</entity>
</fetch>

——————————Below fetch can be used in fetch based report———-

<fetch mapping=”logical”>
<entity name=”systemuser” >
<attribute name=”fullname” />
<attribute name=”systemuserid” />
<link-entity name=”systemuserroles” from=”systemuserid” to=”systemuserid” alias=”systemMapping” >
<link-entity name=”role” from=”roleid” to=”roleid” alias=”RoleTable” >
<attribute name=”name” />
<attribute name=”roleid” />
</link-entity>
</link-entity>
</entity>
</fetch>

 

Advertisements

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s