Powershell Logo

It’s always quite a hassle if you want to copy a file to the current User Profile, if you are running a script via Configuration Manager, as the script is run in System context. Another way of going around this issue is to set “Install as User” for the Deployment Type. This is however only possible if you are installing an Application and the user also needs to be a local admin on the machine, which in most cases is not permitted.

If you want to copy files to the currently logged on user, you can use this workaround. This will copy the file to all User profiles, except for the Public one. This works great if only one person logs in to the computer, but might not work well if more than one person logs in, as the file will be copied to all profiles in C:\Users.