Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Disabling users in MS CRM

Posted on by 80

Hello,

We are using MSCRM 2015 on premise version. I have couple of questions about disabling users from MSCRM using active directory

1) Is there any automated process already in MS CRM to disable users when users are disabled in Active directory?

2) If Yes, What is the process ?

3) If no, what would be the options to automate the process to disable the users in MSCRM when the user is disabled in Active directory?

Thanks for looking into it

*This post is locked for comments

  • Mikhail Efimov Profile Picture
    Mikhail Efimov 20 on at
    RE: Disabling users in MS CRM

    Hi,

    I have wrote Powershell script for this task, you can download it here:

    gallery.technet.microsoft.com/Disable-Users-in-Dynamics-c9ebd012

  • Suggested answer
    BadrinathB Profile Picture
    BadrinathB 970 on at
    RE: Disabling users in MS CRM

    1) Is there any automated process already in MS CRM to disable users when users are disabled in Active directory?

    Answer: No OOB.

    2) If Yes, What is the process ?

    Answer : You can use 3rd party tools to SYNC active directory and CRM users like kingswaysoft. But doing that will have other demerit points. Check with your business as well. In that case you have to write some custom actions to reassign all the records from that user to a new user. How will you deal with incomplete activities. I remember we used Kingsway soft to SYNC our AD with CRM to create new users but not to deactivate.

    3) If no, what would be the options to automate the process to disable the users in MSCRM when the user is disabled in Active directory?

    Answer: You can also use some batch jobs/Windows task schedulers to read the users from AD and deactivate them in CRM if they are not active.

    Some more 3rd Party tools for you to explore

    www.connecting-software.com/.../connect-dynamics-crm-with-active-directory

    community.dynamics.com/.../211313

    Thanks for looking into it

  • Suggested answer
    Ali Bajwa Profile Picture
    Ali Bajwa 100 on at
    RE: Disabling users in MS CRM

    Hi Kumar

    Have a look at following two articles. These might get you better understanding of Active Directory and Dynamics CRM Users association:

    https://celedonpartners.com/blog/reconnect-active-directory-accounts-dynamics-crm/

    http://eimagine.com/how-to-safely-disable-a-user-in-microsoft-dynamics-crm/

    One of the most important things to be aware of is that when you disable a user account that owns a workflow, it will also disable the workflow job as well. So before any user accounts are disabled, you must make sure any workflows still have an active user account, as this is needed to continue to process workflow jobs.

    Tips on disabling user
    1) First, make sure you reassign any records, workflows or activities associated with this user to another user or team before disabling the user account.
    2) If you only want to disable a user for a short period of time, note that you may have to change user privileges for that period, especially if you want other users to be able to modify records while a user is disabled.
    3) All published workflows should be owned by an administrative account, not an employee account, before disabling a user.

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
  • Vishnu Kumar9 Profile Picture
    Vishnu Kumar9 80 on at
    RE: Disabling users in MS CRM

    Hello Arun,

    Thanks for the info. Do you have any code how I should do this?

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Disabling users in MS CRM

    You can have a nightly job (like C# console app in task scheduler or sql job) which check for disabled AD users & disable their user record in CRM.

    You can have a delta pull from HR system or AD changes in a staging DB to check against.

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: Disabling users in MS CRM

    Hi Kumar_901,

    There are no inbuilt automatic processes for disabling users, but you can disable on-premises users and online users with the C# code in this sample. However, this does not disable users in CRM when a user is disabled in Active Directory.

  • Vishnu Kumar9 Profile Picture
    Vishnu Kumar9 80 on at
    RE: Disabling users in MS CRM

    Thanks Adrian.

    I want to confirm that there is no inbuilt automatic process for disabling users . As of I know, we can write C# Code to disable user in CRM using active directory. I want to see if anyone has the code or if there is any better process for this?

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: Disabling users in MS CRM

    Hi Vishnu Kumar9,

    To answer your questions.

    1. No.
    2. N/A.
    3. I am not aware of any methods for automating this.

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