我只是处理了一个小任务,我想通过Active Directory进行自动化。 我们已经写了一些在这里使用很多的Intranet应用程序。 偶尔有人会去前台工作,而其中一个接待员不在。 他们会一直打电话给我们,让我们把快捷方式放到连接到这些Intranet应用程序的桌面上。 这只是一个麻烦,我敢肯定,AD可以用来在用户的桌面上自动创build指向我们的Intranet应用程序的快捷方式。 唯一的问题是,我不知道如何做到这一点,而作为一个小店,我们现在还没有系统pipe理员。
那么,如何在Windows 2003 Server环境中使用AD来自动创build网站的桌面快捷方式呢?
在Windows Server 2003中,您没有内置的组策略工具,可以为您提供一个良好的GUI来创build和部署快捷方式。 您必须使用VBScript来添加快捷方式。
这是我之前用过的一个 –
' AddDesktopShortcut - adds a desktop shortcut if one does not exist. ' ' first argument = URL or path to desktop application ' second argument = Name of the shortcut ' third argument = path to the icon to use; this must include the icon index as well, eg ' "C:\windows\system32\shell32.dll,15". Pass an empty string, ie "" to ' use the default icon instead. ' repeat these lines for as many shortcuts as you want. AddDesktopShortcut "http://www.google.com", "Google", "" AddDesktopShortcut "http://www.bing.com", "Bing", "C:\Windows\System32\shell32.dll,13" Sub AddDesktopShortcut (ByVal path, ByVal name, ByVal iconPath) Dim objFSO, objShell, strDesktop, objLink, strLinkPath Set objFSO = CreateObject("Scripting.FileSystemObject") Set objShell = CreateObject("WScript.Shell") strDesktop = objShell.SpecialFolders("Desktop") strLinkPath = strDesktop & "\" & name & ".lnk" If Not objFSO.FileExists(strLinkPath) Then ' shortcut doesn't exist, create it Set objLink = objShell.CreateShortcut(strLinkPath) objLink.Description = name If Len(iconPath) > 0 Then objLink.IconLocation = iconPath Else ' change this line to change the default icon objLink.IconLocation = "C:\Windows\System32\shell32.dll,14" End If objLink.TargetPath = path objLink.Save End If ' clean up Set objLink = Nothing Set objShell = Nothing Set objFSO = Nothing End Sub
修改脚本以添加所需的快捷键; 上面的脚本为用户的桌面添加了两个快捷方式,一个用于Google,另一个用于Bing。
一旦你修改了脚本,在你的服务器上,启动组策略pipe理工具(开始 – >控制面板 – >pipe理工具 – >组策略pipe理)。 您可以使用现有的组策略,也可以为此创build一个新策略。 除非已经有了大量的组策略对象,否则创build一个新的组策略对象可能会更容易一些。
在树中find包含要添加快捷方式的用户/计算机的组织单位(OU)或域,右键单击并select“在此域中创build新的GPO并将其链接到此处…”(换句话说 – 我目前没有一个Win2003的服务器箱子)。
命名该GPO,右键单击并select编辑。 然后转到树中的用户configuration – >策略 – > Windows设置 – >脚本 – >login。 用鼠标右键单击它,单击属性。 从那里,单击显示文件button,并将脚本文件复制到那里。 然后回到“login属性”对话框中,单击“添加”,然后input/浏览到脚本文件。 单击确定,closures组策略pipe理编辑器窗口,你应该是正确的。
您可以使用组策略build模工具来查看应用GPO的位置(如果您刚刚按照此处的说明进行操作,它将应用于所选OU /域中的所有用户 – 您可以使用安全组或链接它对其他OU更具体); 或者使用组策略结果工具来查看它的应用位置。