web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

System.DirectoryServices.DirectoryEntry invoke

(0) ShareShare
ReportReport
Posted on by 195

Hi.

I use System.DirectoryServices.DirectoryEntry to create a user on ActiveDirectory.  I can create and I can setpasswrord.

But my problem is, when I set a password, I can't catch the error if the password doesn't respect the password rules.  AX stop on the method INVOKE("SetPassword", ...) and not on the catch(Exception::Error)

When I set a good password, it's works fine.  So, I would like to use the Try Catch and return some error message.

any idea ???

Regards

Dany

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Denis Patrakov Profile Picture
    on at

    Use catch(Exception::ClrError) instead. See also AifUtil::getClrErrorMessage() - you can use it inside the catch block.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans