How to unlock a Nav2013 database
or how to add Yourself to an NAV 2013 db.
-- How to unlock a Nav2013-database
--Step 1:
--Fetch all Win-SID to a textfile
--Run this commad from a cmd-promt.
--c:>wmic useraccount get name,sid >>c:\temp\sid.txt
--Step 2:
--Find Your WIN-sid in the text-file (S-1-5-......) and paste it in to the sql-sqript below.
--Step 3: Change and run Sql-script.
USE [YourDatabase] -- <--Change this
DECLARE @USERNAME nvarchar(50)
DECLARE @WINDOWSSID nvarchar(119)
DECLARE @USERSID uniqueidentifier
SET @USERNAME = 'YOURDOMAIN\YOURUSER' -- <-- Change this
SET @WINDOWSSID = 'S-1-2-33-4444444444-5555555-6666666666-77777' -- <-- Change this
SET @USERSID = (select NEWID())
INSERT INTO
[dbo].[User]
(
[User Security ID],
[User Name],
[Full Name],
[State],
[Expiry Date],
[Windows Security ID],
[Change Password],
[License Type]
)
VALUES
(
@USERSID,
@USERNAME,
'',
0,
'1753-01-01 00:00:00.000',
@WINDOWSSID,
0,
0
)
INSERT INTO [dbo].[User Property]
(
[User Security ID],
[Password],
[Name Identifier],
[Authentication Key],
[WebServices Key],
[WebServices Key Expiry Date]
)
VALUES
(
@USERSID,
'',
'',
'',
'',
'1753-01-01 00:00:00.000'
)
INSERT INTO [dbo].[Access Control]
(
[User Security ID],
[Role ID],
[Company Name]
)
VALUES
(
@USERSID,
'SUPER',
''
)
GO
February 21st, 2013 at 09:01
[…] Bron : My tips Lees meer… […]
April 3rd, 2013 at 01:41
Sweet blog! I found it while browsing on Yahoo News.
Do you have any suggestions on how to get listed in Yahoo News?
I’ve been trying for a while but I never seem to get there! Appreciate it