Deleting old users with TSQL

  • Deleting old users with TSQL

    Posted by Jeff Roe on May 1, 2022 at 1:39 pm
    • Jeff Roe

      Member

      May 1, 2022 at 1:39 PM

      I’m in the process of cleaning up old users that either are no longer active or left over from upgrades where user name formats changed. The intent going forward is to keep users in the system after they leave but remove based on record retention policies.

      The current cleanup problem is that I have a hundred plus users that I need to remove.

      While I can use the user admin in GP to delete, that will be time consuming.

      I do know all the tables in the Dynamics DB that reference users.

      Would I be safe to use SQL to remove from those Dynamics DB tables and drop the users from SQL and DB security?

      ——————————
      Jeff Roe
      Kele Inc
      Bartlett TN
      ——————————

    • Jamie Evenson

      Member

      May 1, 2022 at 3:06 PM

      Hi Jeff,Ā 

      While I usually am happy to support SQL updates, have you thought about using a macro to complete this?Ā  You could record the macro and then build out the code for each user you want to remove. I have used this in the past and it works well.Ā  Let me know if you need more details on this approach.Ā 

      Thanks!

      ——————————
      Jamie Evenson
      CEO
      Najaxa Software
      Fargo, ND
      ——————————
      ——————————————-

    • Jeff Roe

      Member

      May 1, 2022 at 4:36 PM

      Good idea, I have used macros for other things so i’ll try that

      ——————————
      Jeff Roe
      Kele Inc
      Bartlett TN
      ——————————
      ——————————————-

    • Jeff Roe

      Member

      May 1, 2022 at 5:29 PM

      One problem is that when I delete using GP there is still a trail of the user left related to 3rd party ISV apps like Multi Entity from Binary stream, collector, Extender etc.

      ——————————
      Jeff Roe
      Kele Inc
      Bartlett TN
      ——————————
      ——————————————-

    Jeff Roe replied 3 years, 10 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Deleting old users with TSQL’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!