# Connecting to Samba from an Azure joined computer (AAD)

If you're trying to connect to Samba share from a computer that is joined to [Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-whatis?WT.mc_id=AZ-MVP-50003957), then you might encounter this error:


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


![Error](https://cdn.hashnode.com/res/hashnode/image/upload/v1616946227052/ZOh3m4aP3.png)

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
``` 
2. A prompt will appear asking you for the username and password. Fill those in and hit Enter after each one.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1616946660661/8S-d52Uzf.png)


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

![Mapped drive](https://cdn.hashnode.com/res/hashnode/image/upload/v1616946380894/KhY81iDFe.png)

