Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Check if the user is disable in Azure Active Directory

(0) ShareShare
ReportReport
Posted on by 170

I did a batch job to disable the users, in Dynamics AX 2012 R3, when these are disabled in local Active Directory. Is it possible to do it in Dynamics 365 FinOps with Azure AD?

I have used the code below to do it by job.

static void disableUsersMissingInAD(Args _args)
{
    UserInfo                userInfoUpdate;
    xAxaptaUserManager      xAxaptaUserManager;
    xAxaptaUserDetails      xAxaptaUserDetails;
    #Guest
    
    xAxaptaUserManager = new xAxaptaUserManager();

    Global::startLengthyOperation();
    ttsbegin;

    while select forUpdate userInfoUpdate
    order by networkAlias
    where userInfoUpdate.Id != #GuestUser
       && userInfoUpdate.enable == 1
    {
        // Get the single user's details from the kernel class
        xAxaptaUserDetails = xAxaptaUserManager.getDomainUser(userInfoUpdate.NetworkDomain, userInfoUpdate.NetworkAlias);

        // Only show users who are enabled in Active Directory
        if (xAxaptaUserDetails == null || xAxaptaUserDetails.getUserCount() == 0 || !xAxaptaUserDetails.isUserEnabled(0))
        {
            userInfoUpdate.enable = 0;
            userInfoUpdate.update();
        }
    }

    ttscommit;
    Global::endLengthyOperation();
}

  • André Arnaud de Calavon Profile Picture
    283,860 Test role Public on at
    RE: Check if the user is disable in Azure Active Directory

    Hi Rafael,

    The standard Dormant users report is only showing these users. If you need to disable them automatically, then you have to consider creating a customization again or go for an ISV solution.

    How to interact with Azure AD? There is an example on the Users form for importing users from Azure AD.

  • Rafael Araujo Profile Picture
    170 on at
    RE: Check if the user is disable in Azure Active Directory

    Hi André,

    In AX solution we have the option to set the maximum days without access the system (default is 60 days) and I want to do the same in D365. 60 days without access the AX or disable in AD.

  • André Arnaud de Calavon Profile Picture
    283,860 Test role Public on at
    RE: Check if the user is disable in Azure Active Directory

    Hi Rafael,

    It is possible to do this. We have a security and compliance solution where it is one of the features.

    Dynamics 365 also has a new report which could show the dormant users. You can then get a list of users not having used the system for e.g. 60 days.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Jahanvi Profile Picture

Jahanvi 34

#2
PJ JohnPaul Profile Picture

PJ JohnPaul 5

#3
SudhanshuMSID Profile Picture

SudhanshuMSID 1

Overall leaderboard

Product updates

Dynamics 365 release plans