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 NAV (Archived)

Rename User windows name in Navision & Rename his Sales Person code

(0) ShareShare
ReportReport
Posted on by 462

Due to the fact that some users in our company get married or they get divorce they have to change their names. Generally, I know how to do this in Navision but its not that easy.

Problem is when I try to rename the windows name it takes like forever and many users in our company will be blocked during the operation. I also tried to do it after working times and still it took like for ever.

I am sure there is a better way to do this? any ideas?

Ps: We update our NAV system at the beginning of this year to NAV_2016. 

*This post is locked for comments

I have the same question (0)
  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    What do you mean by renaming? The full name can be renamed when you want without blocking. Instead, if you mean to change the Windows login, you've to re-create the login in Active Directory and then re-create the user in NAV.

  • M.Zayed Profile Picture
    462 on at

    Hi,

    Our IT change the name in the Active directory. So, now the active directory account in Navision is also changed!

    Problem is even when the active directory account is renamed! still the username in Navision still need to be renamed manually.

    For example, i need now to change the user name lets say in Active directory it is Domain\MZAYED & User name is Domian\MTELL. I need to change the Domain\MTELL to Domian\MZAYED.

    We donot want to create a new Active directory account we want to use the old one. Thats why our IT department rename the active directory account. due to this action the windows user name have to be changed in Navision.

  • Verified answer
    Rahman Erlebach Profile Picture
    on at

    SQLSearchstringProc.rar

    I have a good trick:

    You can use the attached script, to look for specific strings inside the database itself, this means, you can look for the old name as a sting all over the database.

    Once you know where exactly, you can develop another script just to replace it, once you test this couple of times, you can have this job even automated, this is how we usually deal with the subjects Related to user naming in NAV DBs.

    Rahman

  • M.Zayed Profile Picture
    462 on at

    Thanks Rahman :)

    I was looking for something like ;)

    Ramadan Kareem

  • Suggested answer
    Olister Rumao Profile Picture
    3,967 on at

    Hi,

    Can't you login in NAV through the admin account and change the names manually.

    If for some reason you want to automate the process you need to follow few procedure

    1. Create the a table that maps OldUserName to NewUsername say MyUserMappingTable.

    2. Write the code to modify the current username with the help of UserMappingTable.

    Code:

    MyUserMappingTable.RESET;

    IF MyUserMappingTable.FINDSET THEN

    REPEAT

     UserTable.RESET;

     UserTable.SETRANGE("User Name",MyUserMappingTable.OldUsername);

     IF UserTable.FINDFIRST THEN BEGIN

      UserTable.RENAME(UserTable."User Security ID",MyUserMappingTable.NewUsername);

     END;

    UNTIL MyUserMappingTable.NEXT=0;

    Note: Use this code method only when there is a single login such as admin.

    If no one can login into the NAV then you might have to either delete the data from User,User Personalization and Access Control via SQL query

    USE [Database Name];

    delete from [dbo].[User]

    delete from [dbo].[User Property]

    delete from [dbo].[Access Control]

  • Rahman Erlebach Profile Picture
    on at

    You are Welcome :)

    Allah Akram :)

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 NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans