11/7/2023 0 Comments Clear facebook shortcutsIt’ll of course also verify that the name matches the filter you specified. So, if the file is labled ‘My.lnk.exe’ it wouldn’t get past this check as the file object extension name is. Yeah, I know, I could potentially have a file labled ‘My.lnk.Exe’ but we’ll take care of that in our ‘IF’ statement where we check for the file extension name. Then collecting all files on the current desktop that matches ‘.lnk’. It’ll give you event ID 7 for Informational, 14 for Warning and 31 for Error. It writes to the ‘Event Viewer’ in the ‘Application’ log user source name ‘Remove-DesktopShortcut’ for easy filtering. Note! Both the ‘Public’ and the ‘CurrentProfile’ code have the same logic. Lastly, lets send it off to the ‘Remove-Shortcut’ function with that path. For each desktop, figure out what the path is for that one specific. If it’s not the labeled ‘Public’ then find out how many desktop folders the user has. If you use the ‘AllProfiles’ switch the code looks like this: On top of that you have the public profile which desktop folder is labeled ‘Public Desktop’ instead of the normal ‘Desktop’… The user might also have OneDrive for Business which again could make the user have yet another desktop – ‘OneDrive Corp Name\Desktop’ If the user has a policy for “known folder move” it’ll move the desktop to the ‘OneDrive\Desktop’. “Microsoft” would remove every shortcut with that in its name like ‘Microsoft Edge’ or ‘Microsoft Teams’ or ‘Something from Microsoft’.įurther, I learned that a user might have multiple desktops. Examples: “oo” (without the quotation marks) would remove ‘Facebook’ but not ‘OneNote’. The filter can be “” (double quotation marks) to remove all (!) shortcuts on the desktop, or any part of the shortcut name you want to remove. The scope can either be ‘CurrentProfile’ or ‘AllProfiles’ depending on your needs. The script has two parameters: Scope and Filter. If you also have enabled ‘Enterprise State Roaming’ and do a reset of your device, it’s even more fun! Once you’ve logged in again and have got a fresh new version of Edge and Teams, it’ll sync your profile and suddenly you have two (or maybe a lot more) Edge/Teams shortcut(s) on your desktop. And as Michael mentioned in his blog, only if Teams did the same …Īnyhow, so what if you’ve already deployed a bunch of applications that created shortcuts on your desktop? Both Michael Niehaus and Per Larsen have blogged about how to do this (links at the end). You’ve probably seen and read that we now can deploy Edge without creating yet another desktop shortcut.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |