Map a Network Drive with Intune

Map a network drive using PowerShell and Microsoft Intune. Review user context, share permissions and connectivity before assigning the script.

Map a Network Drive with Intune

To map a network drive with Intune, deploy a PowerShell script in the intended user’s context. The user still needs access to the SMB share and the network path. Intune distributes the script; it does not supply file-server permissions or VPN connectivity.

This guide retains the original deployment screenshots. The added troubleshooting notes were reviewed against Microsoft documentation on November 5, 2026; the examples have not been executed in a Windows tenant for this update.

Why map a network drive with Intune

Before we map a network drive with Intune, it helps to know why the script approach wins. Group Policy drive maps assume a domain-joined device with line of sight to a domain controller, which modern cloud-managed endpoints often do not have. With Intune you target Entra ID groups, deploy at scale, and report on success — no logon scripts or GPO required. If you are new to packaging logic like this, my other Intune guides walk through the same deployment model used here.

Create the PowerShell script

In my Git repository I have put a script to map a network drive. This is only a one-liner. You still have to enter the network address here. The official New-PSDrive documentation on Microsoft Learn covers every parameter in detail.


New-PSDrive -Name "K" -PSProvider FileSystem -Root "ADDRESSOFTHEFILESHARE" -Persist

When running from a .ps1 file, also set -Scope Global so the mapping is not limited to the script’s scope:

New-PSDrive -Name "K" -PSProvider FileSystem -Root "\\fileserver\share" -Persist -Scope Global -ErrorAction Stop

Replace the example server and share. Check whether K: already exists before assigning this script; do not overwrite an unrelated mapping. Microsoft explains persistence and scope in the New-PSDrive reference.

Two parameters here matter more than they look. -Persist writes the mapping into the user’s profile so it survives a reboot and shows up in File Explorer under “This PC”, exactly the experience users expect from a real drive letter. The drive must also be created in the user context, not as SYSTEM, otherwise the letter is created in a session no one ever sees – which is why the Intune setting we pick in the next step is so important. If you need to point several teams at different shares, duplicate the one-liner with a new drive letter and root path per group rather than branching inside a single script.

Add the Script in Intune

  • Now we just need to deploy the scripts via Intune. To do this, we open the Intune admin center and navigate to Devices -> Scripts
  • Click ADD

Map a network drive with Intune from the Devices Scripts page

  • Enter a name
  • Click Next

Add the PowerShell script to map a network drive with Intune

  • Upload the script
  • Select Yes at “Run this script using the logged on credentials“
  • Click Next

Map an Networkdrive with Intune

  • Click Add Groups
  • Select a Group and click Select
  • Click Next

Map an Networkdrive with Intune

  • Click Add

Map an Networkdrive with Intune

That is an easy and fast way how you can map a network drive with Intune.

Stay healthy, Cheers
Jannik

Common pitfalls when you map a network drive with Intune

Test the UNC path in File Explorer as the affected user before investigating Intune. Check DNS, SMB connectivity and the account’s share and NTFS permissions. Entra join alone does not decide which authentication configuration your file server needs. A mapping created in an elevated session may also be absent from the normal user’s Explorer; Microsoft explains this session visibility limitation.

If your shares only host user documents or team folders, consider whether OneDrive Known Folder Move or a synced SharePoint library is the better long-term answer. UNC drives still make sense for legacy LOB apps or DFS namespaces where you rely on site-aware referrals – just resolve the DFS root, not a specific server.

Audit failures via %ProgramData%\Microsoft\IntuneManagementExtension\Logs\AgentExecutor.log to catch broken credentials, blocked ports, or DFS resolution issues early. With these checks in place you can confidently map a network drive with Intune across both hybrid and cloud-only fleets.

If the drive is missing after deployment

  1. Open the UNC path as the same user. Resolve access or network failures before reassigning the script.
  2. Check Run this script using the logged-on credentials and the device’s script result. The current navigation is Devices > Scripts and remediations > Platform scripts.
  3. Compare the normal and elevated sessions; test the required drive letter after sign-out and sign-in.
  4. Review AgentExecutor.log and IntuneManagementExtension.log under %ProgramData%\Microsoft\IntuneManagementExtension\Logs.

An Intune platform script is not a recurring logon script. After a successful execution it runs again only when the script or policy changes. If the share was unavailable at first run, choose a deliberate retry strategy rather than expecting execution at every sign-in. See Microsoft’s PowerShell script behavior and prerequisites.

May Cloudflare measure page views, visits and loading times? The analytics service uses no tracking cookies or session recordings. You can change your choice in the footer at any time.

Privacy details