Business Central Musings

For the things we have to learn before we can do them, we learn by doing them

The windows account could not be mapped to a valid security identifier (sid).

Share This Post

Problem

A bit of context here … I was trying to create an environment in which to write an extension around workflows and notifications.

I needed 2 users, one to generate the document and the other one to receive the notification to approve it.

I decided to create a local Business Central sandbox and point my extension to this environment.

So I ran the New-NavContainer cmdlet as below

create sandbox

When I try to create the user as a local Windows user in the host, and in the Business Central sandbox the username gets translated into the SID for that Windows:

create user windows cred

And after I logged as the new local user, launching BC sandbox Client it fails:

login failed

Then I’ve seen someone recommending to run New-NavContainerNewUser … so I gave it a try:

new-navcontainernavuser

This is the issue and I have not been able to find a solution yet.

Workaround

Create the sandbox with “-Auth NavUserPassword” like below:

sandbox with navuserpwd

You will be prompted for credentials of the first user (I named mine svi) when you run the script.

The cmdlet New-NavContainer will create among many other things, a sql login with sysadmin server role.

sql

Once the script is finished, launch BC Sandbox client, use the credentials entered at installation and create a new user.

Now I have 2 users and can continue my tests on Workflows/Approvals:

users

If you have a solution for a local BC sandbox with Credential Type (-Auth param in New-NavContainer) set to Windows and the issue expressed in the title, please leave a comment with your solution.

Otherwise, I hope this workaround can help anyone with the same issue.

Share This Post

Related Articles

Leave a Reply

Recent Posts

Get Notified About New Posts

Categories

Discover more from Business Central Musings

Subscribe now to keep reading and get access to the full archive.

Continue reading

Verified by MonsterInsights