Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Run assembly as another user

Posted on by 70

Hello,

How can I run assembly in another user ?

Thanks.

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Run assembly as another user

    Hi Marina,

    You could achieve this by two approach.

    1. Using code - while retrieving the service inside plugin

    2. Using plugin registration tool

    Please refer below url for more info:

    www.magnifez.com/.../

  • Suggested answer
    Remi Boigey Profile Picture
    Remi Boigey on at
    RE: Run assembly as another user

    Hello Marina,

    Based on your question i'm guessing that you are trying to impersonate a user during a plug-in execution.

    In that case there is 2 ways of doing this:

    - Through UI:  by using the plug-in regitration tool you can easily specify the user context (the default value is Calling User)

    - By code: you can override the setting specified at registration at run time by setting the IOrganizationServiceFactory.CreateOrganizationService(Nullable<Guid>) userId parameter.

    You will find more details into the below documentation links:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/impersonate-another-user

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/impersonate-a-user

    Hope this helps!

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Run assembly as another user

    Hello,

    Do you mean impersonate code with another user?

    If this is what you mean then you cam simply use Plugin registration tool to set Run in user context to the user through which you need to execute the logic.

    Please let me know if this helps !

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Run assembly as another user

    Hello,

    Can you please provide more details about your scenario?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans