Product: ProfileUnity-FlexApp
Product Version: 6.x
Updated: October 25, 2019
Description
ProfileUnity can execute a powershell script to pin items in Windows Explorer's Quick Access area.
Resolution(s):
Create a powershell script with using the following:
Modify the \\Server\Share\ variables to fit your environment.
$o = new-object -com shell.application
$o.Namespace('\\Server\Share\').Self.InvokeVerb("pintohome")
If you want to pin an item using the username variable you will just need to modify the \\Server\Share\ in the following.
$username = $env:USERNAME
$userdatapath = "\\Server\Share\"
$fullpath = join-path $userdatapath -childpath $username
$o.Namespace($fullpath).Self.InvokeVerb("pintohome")
You can have multiple items added in a single powershell script file. For example, the following will add both a share and the user's directory to Quick Access.
$o = new-object -com shell.application
$o.Namespace('\\Server\Share\').Self.InvokeVerb("pintohome")
$username = $env:USERNAME
$userdatapath = "\\Server\Share\"
$fullpath = join-path $userdatapath -childpath $username
$o.Namespace($fullpath).Self.InvokeVerb("pintohome")
Save the ps1 to a share location accessible to your users.
For example: \\Domain\NETLOGON\ProfileUnity\Scripts
Edit your existing configuration.
Create an Application Launcher rule with following settings:
Filespec: C:\windows\system32\cmd.exe
Arguments: /c powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo <path to PS1 >
Argument Example: /c powershell.exe -executionpolicy bypass -windowstyle hidden -noninteractive -nologo \\Domain\NETLOGON\ProfileUnity\Scripts\ScriptName.PS1
Save the new rule & update/deploy your configuration.
Note: PowerShell script will be run with elevated privileges.