Akif's profileAkif - akif.tech.aePhotosBlogListsMore Tools Help
    September 09

    How to find all shares in MS CRM 4

    While implementing CRM at one of our clients, I was asked to provide them a report of all shares by one user. I was sure it must have to do something while displaying all items views in CRM. So I used SQL Profiler to find exact query used by CRM to fetch all items on which a user has access and from them extract the part which returns all shares for a user. This is what I got and it is really simple to find shares :)
     
    select
    POA.* from PrincipalObjectAccess POA join SystemUserPrincipals sup on POA.PrincipalId = sup.PrincipalId
    where
    sup.SystemUserId = '6130B308-2692-DE11-A9EF-000C29F4EE9D' and POA.ObjectTypeCode = 4200 and
    ((
    POA.AccessRightsMask|POA.InheritedAccessRightsMask) & 1) = 1

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://aakif.spaces.live.com/blog/cns!C8D5222E0E2125AE!575.trak
    Weblogs that reference this entry
    • None