如何通过域组策略pipe理“networking位置”?

我知道如何通过GPO映射networking驱动器,但我想映射一个“networking位置”:

在这里输入图像说明

我知道如何通过Windows资源pipe理器将这些添加到工作站本身:

在这里输入图像说明

但我不知道如何通过GPO添加/删除它们。

我创build了下面的函数来完成同样的事情。 您可以将其包含为login脚本的一部分。 用法如下:

 New-NetworkShortcut -Name 'New Network Shortcut' -Target '\\server\share\path' 
 function New-NetworkShortcut() { param( [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 $Shortcut.Save() } 

您实际上可以使用组策略映射快捷方式。

使用Server 2012 R2 Essentials ,我从我们公司的SharePoint Online站点映射了一个WebDAV文件夹。


组策略pipe理编辑器中

  1. 转到“用户configuration/首选项/ Windows设置/快捷方式”
  2. 右键点击快捷方式列表,然后点击“ 快捷方式
  3. 使用以下设置

设置:

  • 目标types =文件系统对象
  • 位置 =我的networking位置
  • 目标path = \\ CONTOSO.sharepoint.com@SSL \ DavWWWRoot \ FOLDER \ SUBFOLDER
  • 对于目标path,请将CONTOSOreplace为贵公司的子域。
  • 在我们的例子中,FOLDER是根目录下的团队网站,SUBFOLDER是我们想要映射的文档库。

笔记:

  • 这也应该与计算机configuration ,但我没有testing它。
  • 这也应该与其他types的股票,但我没有testing它。