techbits.io

Map a network drive on Windows Server Core

Using Server Core and realised you can't go into Windows Explorer to map a drive? Here's how to map drives on Windows Server Core.

Map a network drive on Windows Server Core

Windows Server Core is a great choice of OS if you’re trying to use as few system resources as possible, or you want a system that presents a smaller security risk, but some tasks that are second nature on the Desktop Experience equivalent can make you stop and think.

Browsing to a UNC path is one such thing, but fortunately, the same command line method that can be used on all other Windows OSs works on Server Core too.

To map a drive, use the net use command.

Browse to the UNC path

The following will initiate a connection to the storage path, and authenticate using the specified details.

net use \\servernameorIP\share /user:username password

If you’re logged in using a domain account (or a local account that matches a user/password on the storage system), you can ignore the /user:username password part.

Once it has authenticated, you can use the cd command to change to that directory and browse the contents:

cd \\servernameorIP\share

dir ## <- lists the directory contents

Mapping a drive

Mapping a drive can be more useful as you can then refer to the mapped letter for any further commands. You’ll need to pick a drive letter that’s not in use, but besides that, the command is largely the same as above. Use /persistent if you want the drive to re-map at each login.

net use T: \\servernameorIP\share /user:username password

net use T: \\servernameorIP\share /user:username password /persistent

Now you can browse to the share, and list the contents as before, but using the assigned drive letter.

cd T:

dir

That’s it! That’s the basic stuff for net use, and of course, it’s as applicable to desktop experience Windows versions as Server Core. Do you know of any useful net use tidbits? Let me know below, or over at @techbits@fosstodon.org.

Share this article:

Comments

Related posts

Remove Snipping Tool as default Windows Screenshot Tool
#windows

Remove Snipping Tool as default Windows Screenshot Tool

Snipping Tool isn't a bad utility, but Windows' obnoxious behaviour when it comes to remapping shortcuts can make using an alternative tricky.

Add Windows Server Core to existing Active Directory Domain
#active-directory #windows-server #windows

Add Windows Server Core to existing Active Directory Domain

This guide will show you how to add a new domain controller to an existing Windows Active Directory Domain on a Server Core 2022 system.

Create a new Active Directory Domain on Windows Server Core
#active-directory #windows-server #windows

Create a new Active Directory Domain on Windows Server Core

Want to create a Windows Active Directory Domain (and Forest) on a Windows Server Core system? This guide will teach you how!