Nethserver Domain - mapping home drive to drive letter upon login

NethServer Version: 7.8.2003

Hello @support_team et all!

I’ve setup my Nethserver as our office domain. I’ve noticed that for each of my users they are automatically provided storage space on our Nethserver under their domain name. I can remember when I used to use Zentyal I would be able through the GUI to provide a drive letter to all users automatically when they logged in. So I would assign the letter H: (for Home drive) and when each user logged into their computer they would automatically have available to them their H: Home drives.

This would be a nice feature to add to Nethserver! :slight_smile:

But could someone provide details for me on how I can through AD do the same for my users? I use RSAT on a windows server and I use this to provide file shares to users/computers already through Nethserver File Sharing. What I would like to add is a generic Drive Mapping through AD that would add an H: drive to each user where the wildcard would be the user name. I don’t want to add an H: drive to each user separately but have AD know that based on the user name a Drive H: would be created at login on any computer they use where the H: drive would map to their domain name folder on Nethserver.

Hopefully I’ve explained myself on what I’m looking to do. Any advice would be greatly appreciated.

Thank you.

Check out this thread, it might be what you are after; using group policy to map drives for users.

1 Like

Thank you @royceb for this reply.

That was a thread I was a part of when I first started using Nethserver as my office do ain. :slight_smile:

I’m trying to get away from using login bat files for my drive mapping and use group policy through RSAT. I know how to map drives toAD users and computers. But what I want is to add each users domain user folder and In AD drive mapping add in a %username% global type variable so any user that logs in will get their drive added to H.

Thank you.

.
I am a total goof sometimes :sweat_smile:. I was so focused on remembering and finding that old thread that I didn’t bother to look at thread itself.

1 Like

Hi Team,

I did some more digging and I found my answer. In RSAT I create the new GPO and called it Home Drive.
I edit the new GPO and navigate to User Configuration > Preferences > Windows Settings > Drive Maps.
I right click on Drive Maps and select New > Mapped Drive.
On the General Tab I use the following in the Location Field.
Select a drive letter as well.

\10.100.1.2%username%@mycom.local

image

Flip to the Common Tab and check the "Run in logged-on user’s security context (use policy option)

image

Apply and save your new GPO.
Don’t forget to link to your new GPO.

I then update my policy settings on a workstation using:

gpupdate /force

And my new H: drive shows up!

But now I have a new question…

I want to now add this new Nethserver User Home folder in Nextcloud as an external storage.
I found the location of all the home folders here on Nethserver:

/var/lib/nethserver/home/

On Nethserver External Storage I have various options. I had thought I would use Local but in the share I tried using the following:

/var/lib/nethserver/home/%username%

But that did not provide a checkmark for a successful connectiong. In my Nextcloud logs I see the following PHP Error:

stat(): stat failed for /var/lib/nethserver/home/%username%/ at /usr/share/nextcloud/lib/private/Files/Storage/Local.php#145

Any idea’s on how I can mount this local folder as external storage on Nextcloud using a wildard %username%. Or will I need to create an external storage for each user account manually on Nextcloud?

Thanks!

I am thinking up no real good way to do that. My first thought was to do a symlink between /var/lib/nethserver/home/ and a Shared Folder created (located at /var/lib/nethserver/ibay/ i think) that was managed via ACL. This just seems wrong to me though for how many layers of permissions going between stuff.

The other was to have each remote user install the Nextcloud app and manually add each user’s home network folder to synchronize. You will have a duplicate data though on your device :confused: not optimal at all.