Skip to main content

Command Palette

Search for a command to run...

Connecting to Samba from an Azure joined computer (AAD)

Published
2 min read
B

Expert generalist • Independent Contractor • Microsoft MVP • Home Assistant enthusiast Hi there! I'm Bogdan Bujdea, a software developer from Romania. I'm currently a .NET independent contractor, and in my free time I get involved in the local .NET community or I'm co-organizing the @dotnetdays conference. I consider myself an expert generalist, mostly because I enjoy trying out new stuff whenever I get the chance and I get bored pretty easily, so on this blog you'll see me posting content from programming tutorials to playing with my smart gadgets.

If you're trying to connect to Samba share from a computer that is joined to Azure Active Directory, then you might encounter this error:

A specified logon sessions does not exist. It may already have been terminated.

Error

On my personal laptop I can do this and it works just fine, but on my work laptop I get the error above. I assume it has something to do with the fact that my work laptop uses Windows 10 Enterprise and/or it is an Azure joined device.

Solution

Even though I'm not sure what's wrong, here's a solution that works:

  1. Open Powershell/CMD and type this command:
net use * \\server\path

Replace \server\path with the address of your server and the path that you want to map. In my case, I want to connect to 192.168.1.61 and map the path \share, so the command looks like this:

net use * \\192.168.1.61\share

  1. A prompt will appear asking you for the username and password. Fill those in and hit Enter after each one.

image.png

Once you fill those in, the new drive will be mapped and you can access it from Explorer.

Mapped drive