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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    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.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    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.

  • Community Member Profile Picture
    on at

    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
    Ben Thompson Profile Picture
    6,350 on at

    @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...

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi everyone,

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans