Create shortcut on Desktop via Group Policy, but replace present shortcut

6,211

Sounds like a job for a Group Policy Preference

Create new shortcut(s) in your GPO using a GPP, use Replace as action (make sure you use the same filename as the one you are trying to replace) You can use Item Level targeting to narrow down your targets (i.e. different targets based on group membership, etc).

Share:
6,211

Related videos on Youtube

Big2tha.E
Author by

Big2tha.E

Updated on September 18, 2022

Comments

  • Big2tha.E
    Big2tha.E almost 2 years

    We are running 2008R2 on our PDC. We had a group policy to add the Help Desk Portal shortcut to everyone's desktop via the User config. Do to a split in coverage, we now need 2 different versions. The problem being that the OLD Group Policy was removed, but the shorcuts were not set to go away with it.

    When we try to add a new shortcut, we end up with 2 on the desktop.

    The Old was company wide, so it is on almost every machine. The new was being added to the user OU for each office OU, depending on what side of the globe they are on for which version.

    I tried putting the old GPO back with "remove" for the shortcut, but nothing happened. I really don't want to touch each PC, even if I could.

    • Ramhound
      Ramhound almost 10 years
      Sounds like you should run a script once on all computers. Delete the existing shorcut then place a new shortuct based on the criteria you set forth.
    • Big2tha.E
      Big2tha.E almost 10 years
      That is what I was thinking, but using "%userprofile%\Desktop\Global IT Support Portal.lnk" as the target doesn't seem to work.
    • Big2tha.E
      Big2tha.E almost 10 years
      I tried the following vbs: Set Shell = CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") DesktopPath = Shell.SpecialFolders("Desktop") FSO.DeleteFile DesktopPath & "Global IT Support Portal.lnk"
  • Big2tha.E
    Big2tha.E almost 10 years
    I tried that as well. It still created an identical shortcut. The first instance happened right after I moved the GPO down to the user level. I had not changed the GPO at all. It was originally set to "update."
  • Big2tha.E
    Big2tha.E almost 10 years
    I take that back. I'm not sure what I did differently, or whether there were too many attempts in short succession, but it has now worked with "Replace", "Run in logged-on user's security context" and "Remove when no longer applied." I thought those were used before, but....