Skip to main content

Posts

Showing posts with the label Group Policy

PowerShell copy file, link or folder to users’ desktop

Deploying a shortcut link, file or folders can easily be done via group policy preferences.
Or it can also be done using PowerShell as logon or start up script.
A one liner code snippet to deploy a file, a shortcut links or a folder to user’s desktop.
Copy a file: copy-item "\\shared_folder\files_2be_copied.txt" "c:\users\public\desktop"

Copy a shortcut link to user desktop: copy-item "\\shared_folder\shortcut_file_2be_copied.lnk" "c:\users\public\desktop"

If a link or shortcut which is a network path, just need to ensure that the permissions is set correctly or else the link will be deployed but still unable to access due to permission issue.

Copy a folder: copy-item "\\shared_folder\folder_2be_copied" "c:\users\public\desktop" -Container -Recurse


Above command will copy the whole folder to the user's computer, if space is an issue then a shortcut to the folder would be desirable.




================================ Free Android A…