Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how to map network drives through GPOs, but I would like to map a "network location":

enter image description here

I know how to add those on the workstation itself through Windows Explorer:

enter image description here

But I don't know how to add/remove them through GPOs.

share|improve this question
I've tried to find an answer for this myself, and came up empty, so let us know if you find something. I've even used procmon to capture file/reg changes. – Bret Fisher Sep 17 '12 at 22:39
@BretFisher: Oh wow, that really puts my hopes down :( I hoped that there is a built-in approach. For this task at hand I really wouldn't want to roll anything from scratch, mapped network drives are actually an option. I'll look into it though, as this seems like a much more elegant approach. If you don't mind, I'd love to have a look at whatever procmon results you'd want to share. My email is in my profile :) – Oliver Salzburg Sep 17 '12 at 23:38
If you are willing to do drive mappings life is good! Use Group Policy Preferences (shown as Preferences in gpo edit mmc) to map drives. Personally I feel the drive mapping concept is legacy but we've got no great alternative for network file share access yet... so map away. Other then only having ~20 letters for mappings, there's no real down side to drive mappings. Preferences let's you map drives on all sorts of if/elseif statements including group membership, any value in AD, or just about any attribute of a machine. What's your reason for wanting network location over drive mappings? – Bret Fisher Sep 18 '12 at 1:33
@BretFisher: Just as you said. It felt legacy and I wanted to see if there are other options. This looked like a much better approach. The concept of drive letters seemed unnecessary, and the drive letter that would fit this network location just perfectly is always already taken by another assignment :D Thanks for your advice. – Oliver Salzburg Sep 18 '12 at 9:59
@BretFisher Turns out it's simply a folder which contents are displayed in that area. You can place anything you want there. Just have a look at C:\Users\username\AppData\Roaming\Microsoft\Windows\Network Shortcuts – Oliver Salzburg Jun 3 '14 at 14:04
up vote 3 down vote accepted

I created the function below to accomplish the very same thing. You can include it as a part of a login script. The usage is as follows:

New-NetworkShortcut -Name 'New Network Shortcut' -Target '\\server\share\path'
function New-NetworkShortcut()
        [Parameter(Mandatory=$true)] [string]$Name,
        [Parameter(Mandatory=$true)] [string]$Target

    $networkshortcut_name = $Name
    $networkshortcut_target = $Target

    $networkshortcuts_path = [Environment]::GetFolderPath('NetworkShortcuts')

    $networkshortcut_path = "$networkshortcuts_path\$networkshortcut_name"
    $desktopini_path = "$networkshortcut_path\desktop.ini"
    $targetlnk_path = "$networkshortcut_path\target.lnk"

    $desktopini_text = "[.ShellClassInfo]`r`nCLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}`r`nFlags=2"

    if( Test-Path -Path $networkshortcut_path -PathType Container )
        Remove-Item -Path $networkshortcut_path -Recurse -Force

    [void](New-Item -Path $networkshortcut_path -ItemType directory)

    Set-ItemProperty -Path $networkshortcut_path -Name Attributes -Value 1

    Out-File -FilePath $desktopini_path -InputObject $desktopini_text -Encoding ascii

    Set-ItemProperty -Path $desktopini_path -Name Attributes -Value 6

    $WshShell = New-Object -com WScript.Shell
    $Shortcut = $WshShell.CreateShortcut($targetlnk_path)
    $Shortcut.TargetPath = $networkshortcut_target
share|improve this answer
Sorry for the 1year delay ;) This works great and it also made me realize what the underlying concept of these network locations is. I wasn't aware that it is simply a folder into which you can place arbitrary shortcuts. This is pretty awesome. – Oliver Salzburg Jun 3 '14 at 14:02
No problem, I can't believe that was a whole year ago. Glad it works for you! – charleswj81 Jun 4 '14 at 4:16

You can actually map the shortcut using Group Policy.

Using Server 2012 R2 Essentials, I mapped a WebDAV folder from our companies SharePoint Online site.

In Group Policy Management Editor:

  1. Go to 'User Configuration/Preferences/Windows Settings/Shortcuts'
  2. Right click in the list of shortcuts then click 'Shortcut'
  3. Use the following settings


  • Target Type = File System Object
  • Location = My Network Places
  • Target Path = \\\DavWWWRoot\FOLDER\SUBFOLDER
  • For target path, replace CONTOSO with your company's sub-domain.
  • In our case, FOLDER was a Team Site in the root directory and SUBFOLDER was the document library that we wanted to map.


  • This should also work with Computer Configuration, but I didn't test it.
  • This should also work with other types of shares, but I didn't test it.
share|improve this answer

protected by Community Jan 29 '15 at 13:01

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.