Cannot delete user after upgrade to NAV2013
Alex_Chow
Member Posts: 5,063
This is after we upgraded from NAV2009 to NAV2013. When we tried to delete a user, it gives error:
I changed the State of the user to Disabled and it still gives this error. Interestingly, when I create a brand new user in NAV2013, it does not give this error when I delete them.
Anyone encountered this for upgrades?
Microsoft Dynamics NAV
The user "FAKEUSER" cannot be deleted because the user has been logged on to the system. You must set the user's state to "Disabled".
OK
I changed the State of the user to Disabled and it still gives this error. Interestingly, when I create a brand new user in NAV2013, it does not give this error when I delete them.
Anyone encountered this for upgrades?
Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
0
Answers
-
Hi, Did you ever find a solution to this issue. I am running into the same problem after upgrading a client to NAv2013.
Anu0 -
We had the same problem. with upgrading from Nav2009 to NAV2013 The way we fixed it was through the SQL Management Studio.
Make sure you note down which user you want to remove and their Security ID, and SID.
Example:
SID:
S-1-5-21-385447248-1272852142-134157935-10271
Security ID
16e116cc-2457-4529-8e80-e937864c30f7
Open up the SQL Instance
Open up 'Databases'>'NAV2013'>'Tables'>dbo.User
Right Click dbo.user and select Top 1000 Rows
Look for the user, then right click dbo > Script Table as > DELETE TO > New Query Editor Window
Enter Commands below:
USE [DatabaseName]
GO
DELETE
FROM dbo.[User]
WHERE [User Security ID] = 'actualSID'
DELETE
FROM dbo.[User Property]
WHERE [User Security ID] = 'actualSID'
DELETE
FROM dbo.[User Personalization]
WHERE [User SID] = 'actualSID'
DELETE
FROM dbo.[User Metadata]
WHERE [User SID] = 'actualSID'
DELETE
FROM dbo.[User Default Style Sheet]
WHERE [User ID] = 'actualSID'
DELETE
FROM dbo.[Page Data Personalization]
WHERE [User SID] = 'actualSID'
DELETE
FROM dbo.[Access Control]
WHERE [User Security ID] = 'actualSID'
After verifying the rows with the username, SID, or Security ID are gone from the dbo listed above, open up the NAV client, and see if the user exist. If it does, you can now click on the user and click on delete. It worked for us.0 -
I got the same issue today. Based on SQL Profiler, before deleting an user, NAV checks if a user personalization record for this user is still in the database. After deleting the user personalization record, I was able to delete the user. It seems, this has nothing to do with upgrade, because the database I tested was not an upgraded one.0
-
Juhl wrote:When you have logged in the first time, you cant delete a user. This is per design in 2013 and 2013R2, i dont know why. At least i dont think it is a bug.
Maybe it is related to auditing or something.
Is this related to the error "Table User blocked" when trying to delete a user in NAV 2013 who did at least one access?* Daniele Rebussi * | * Rebu NAV Diary *0 -
This is not an error. The reason for this functionality is to keep the users history. If someone has posted something you must be able to look up this user...0
-
alvi99 wrote:This is not an error. The reason for this functionality is to keep the users history. If someone has posted something you must be able to look up this user...
Even if the user has not posted anything?Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Even if the user has not posted anything?
By design it is not allowed to delete a user after the user has created a profile, indicating activity in NAV, this is for audit purposes. NAV is checking for Personalization as an indication of activity, so assuming the user is no longer needed, removing the personalization (table 2000000073) for the user in the database should allow for deletion (I have not tested this)
Another solution is to just create a filter (in code) on page 9800 Users, which by default makes sure that disabled users are not shown.
OnOpenPage()
SETFILTER(State,'=%1',State::Enabled);
Br,
Alvi0 -
brunelli wrote:I got the same issue today. Based on SQL Profiler, before deleting an user, NAV checks if a user personalization record for this user is still in the database. After deleting the user personalization record, I was able to delete the user. It seems, this has nothing to do with upgrade, because the database I tested was not an upgraded one.
I can confirm that this solved the problem. :thumbsup:Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
These are the tables involved, If you want to delete users.
This script i use to delete all user when needing to gain access to a Customer database, or so.
delete from [dbo].[User]
delete from [dbo].[Access Control]
delete from [dbo].[User Property]
delete from [dbo].[Page Data Personalization]
delete from [dbo].[User Default Style Sheet]
delete from [dbo].[User Metadata]
delete from [dbo].[User Personalization]
But this is not what MS intended, as stated above.Follow me on my blog juhl.blog0 -
Deleting data for the user from 2 tables, did the trick for me:
1. User Personalizaition
2. User Metadata
:whistle: :whistle: :whistle:0 -
--***********************************************************************************
-- Christer Berntsson, Softronic, Stockholm, Sweden,2013-12-18
--
-- Look into and clean Nav201X-tables after Your moved database to other Domain
--
--
--***********************************************************************************
USE [YourDatabase] --<<<<<<<--- [Change to Your database]
GO
--Shows table-content
SELECT * FROM [dbo].[User]
SELECT * FROM [dbo].[Access Control]
SELECT * FROM [dbo].[User Property]
SELECT * FROM [dbo].[Page Data Personalization]
SELECT * FROM [dbo].[User Default Style Sheet]
SELECT * FROM [dbo].[User Metadata]
SELECT * FROM [dbo].[User Personalization]
--3 rows below, Use when move database to new NAV-server-instance
SELECT * FROM [dbo].[Server Instance]
SELECT * FROM [dbo].[Active Session]
SELECT * FROM [dbo].[Session Event]
/*
-- Mark rows and press F5 or press Execute to cleans tables.
--
TRUNCATE TABLE [dbo].[User]
TRUNCATE TABLE [dbo].[Access Control]
TRUNCATE TABLE [dbo].[User Property]
TRUNCATE TABLE [dbo].[Page Data Personalization]
TRUNCATE TABLE [dbo].[User Default Style Sheet]
TRUNCATE TABLE [dbo].[User Metadata]
TRUNCATE TABLE [dbo].[User Personalization]
--3 rows below, Use when move database to new NAV-server-instance
TRUNCATE TABLE [dbo].[Server Instance]
TRUNCATE TABLE [dbo].[Active Session]
TRUNCATE TABLE [dbo].[Session Event]
*/Regards
Christer in Stockholm, Sweden0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

