Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Customize Dynamics to add user IP on user access event in audit record

Posted on by Microsoft Employee

I will appreciate any kind of help to customize Dynamics to add user IP on user access event in audit record. Kindly , take a note that we are using load balancer in production environment. So, in my opinion we have to achieve it by JavaScript coding in order to get client IP.

*This post is locked for comments

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: Customize Dynamics to add user IP on user access event in audit record

    Hi everyone,

    You can retrieve the client's IP address using these web services. This works on Internet Explorer and Microsoft Edge.

  • Suggested answer
    Ben Thompson Profile Picture
    Ben Thompson 6,350 on at
    RE: Customize Dynamics to add user IP on user access event in audit record

    @Goutam,

    How do you get around the issue that Javascript in IE / Edge can't access and retrieve the computer's IP address... I'm sure I've previously highlighted that issue in another thread created by the OP where I stated that his requirement cannot be met...

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Customize Dynamics to add user IP on user access event in audit record

    Dear Goutam,

    Ton of thanks for your quick response and details explanation!!.

    Now, requirement is very specific to me . We need to capture client IP only on the user log in event. Still, I couldn't able to figure out the JS which will work on all browser to know the client IP. Even, Server side code also have the issue because we have load balancer . From the server side code , we are not getting client machine  IP rather getting Load balancer IP.

    I will be  very much happy if you can kindly provide some sample code..

    Thanks in advance!!!

    Thanks,

    Dr. Sudhangsu Das

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Customize Dynamics to add user IP on user access event in audit record

    Hi Dr. ,

    There is no OOB functionality to customize the USER audit access as it is a system settings and completely black box for us. Secondly there is no way to pass http context in the plugin so server side logic will also not work to get the client IP . I would suggest you may proceed with creating custom entity with JS solution and from custom entity you can extract the audit access of particular action.

    I have one question here,  do you want to create Audit access every time when user logged ? Or for particular action in MSD?

    If you are tracking for particular action you may follow below steps -

    - Create a custom entity with fields like User lookup,Activity Type (Action Name) , Event Name(Create ,Update,Delete) , Date Time , LastAccess IP.

    - Let say you are doing some operation like Modify Customer Address , whenever you update the address you need to call one common CRM JavaScript function which basically responsible to get the client id.

    - Now once you will get the client IP you can create one record in the mentioned entity with the details.

    - You can create report associated with the custom entity to view the user access for which event.

    If you are tracking ip every time when user logged in irrespective of activity type  then follow below steps ,it will be a problem when user logged in two or three different machine with same user in this scenario.

    - You know there is no straight forward way to call JavaScript function at the time of login , one possibility is to create one Application Ribbon  and register one JS function there. Make sure you hide the button .

    - In the JS function you can get the client IP.

    - Create a custom entity with fields like User Lookup, Activity Type (Action Name) , Event Name(Create ,Update,Delete) ,Date Time , LastAccess IP.

    - Update the entity when client IP got changed.

    Hope this helps.

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: Customize Dynamics to add user IP on user access event in audit record

    Hi Dr. Sudhangsu Das,

    It is not possible to add user IP on user access event to an audit record. You will need to track the client IP with JavaScript and/or a custom HTML web resource.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans