Hide PSM Local Drives
Question
How can I hide the PSM Local Drives from PSM Shadow Users when using WinSCP or other applications?
Environment
v7.2;v7.5;v7.6;v8.0;v8.0 Beta;8.1;v8.2;v8.5;v8.6;v9.0;v9.1;v9.2;9.3;9.5;9.6;9.7;9.8;9.9;9.9.5;9.10;10.1;v9.97;v9.8.3;v9.8.1;v9.7.5
Answer
Change the policy in the Default User profile so that the desired drives are hidden recreate the Shadow User profiles
Manual Process:
- In Regedit, load the Default User registry hive
- Launch Regedit.exe
- Select HKEY_LOCAL_MACHINE in the left window pane
- Select (File – Load Hive)
- In the load hive dialog select or type “C:\Users\Default\NTUSER.DAT” and click Open
- In the second load hive dialog enter “defaultuser” for Key Name and click OK
- Expand the Registry to the CurrentVersion Key
- Expand HKEY_LOCAL_MACHINE
- Expand defaultuser
- Expand Software
- Expand Microsoft
- Expand Windows
- Expand CurrentVersion
- Look for the Policies key under CurrentVersion. If it does not exist, create it. If it does exist Expand it.
- Right-click CurrentVersion
- Select (New – Key)
- Enter Policies for the name of the key
- Look for the Explorer key under Policies. If it does not exist, create it. If it does exist, Select it.
- Right-click CurrentVersion
- Select (New – Key)
- Enter Explorer for the name of the key
- Create a new DWORD Value with the name NoDrives
- Right-click Explorer
- Select (New – DWORD (32-bit) Value
- Enter NoDrives for the name of the value
- Set the value of NoDrives
- Double-Click NoDrives
- Under Base, select the Decimal radio button
- Enter one of the below Decimal values based on your desired use case: (<description>: <decimal value>)
(IE: to hide just the C drive, enter a value of 4)- Do not restrict drives: 0
- Restrict A and B drives only: 3
- Restrict C drive only: 4
- Restrict D drive only: 8
- Restrict A, B and C drives only: 7
- Restrict A, B, C and D drives only: 15
- Restrict all drives: 67108863 (this setting will also prevent drive redirection from the local computer to the target device within a PSM session, e.g. in WinSCP)
- Note: Other values can be used, but these are the default ones provided by the policy setting in Group Policy
- A non default setting successfully tested is to restrict A, B, C, D, and E drives only, with a NoDrives value of 31
- Note: online NoDrive Calculator at http://www.wisdombay.com/hidedrive/
- New Calculator found here https://ss64.com/nt/syntax-nodrives.html
- Click OK
- Unload the Default User Registry Hive
- Select defaultuser under HKEY_LOCAL_MACHINE
- Click (File – Unload Hive)
- Close RegEdit
- Delete existing PSM Shadow User profiles
- From a Run prompt run control sysdm.cpl
- Select the Advanced tab
- In the User Profiles section, select Settings
- Select Shadow User Profile (<computername\PSM-<unique number)
- Click Delete
- Repeat d & e until all desired shadow user profiles have been deleted
*** The attached "HideLocalDrives.ps1" Powershell script can be used to automate steps 1 - 7 of the above manual process. Script should be used in an elevated powershell prompt.
For usage information type:
get-help .\HideLocalDrives.ps1 -detailed
Additional Information
Details
Q:
How can I hide the PSM Local Drives from PSM Shadow Users when using WinSCP or other applications?
A:
Change the policy in the Default User profile so that the desired drives are hidden recreate the Shadow User profiles
Manual Process:
- In Regedit, load the Default User registry hive
- Launch Regedit.exe
- Select HKEY_LOCAL_MACHINE in the left window pane
- Select (File – Load Hive)
- In the load hive dialog select or type “C:\Users\Default\NTUSER.DAT” and click Open
- In the second load hive dialog enter “defaultuser” for Key Name and click OK
- Expand the Registry to the CurrentVersion Key
- Expand HKEY_LOCAL_MACHINE
- Expand defaultuser
- Expand Software
- Expand Microsoft
- Expand Windows
- Expand CurrentVersion
- Look for the Policies key under CurrentVersion. If it does not exist, create it. If it does exist Expand it.
- Right-click CurrentVersion
- Select (New – Key)
- Enter Policies for the name of the key
- Look for the Explorer key under Policies. If it does not exist, create it. If it does exist, Select it.
- Right-click CurrentVersion
- Select (New – Key)
- Enter Explorer for the name of the key
- Create a new DWORD Value with the name NoDrives
- Right-click Explorer
- Select (New – DWORD (32-bit) Value
- Enter NoDrives for the name of the value
- Set the value of NoDrives
- Double-Click NoDrives
- Under Base, select the Decimal radio button
- Enter one of the below Decimal values based on your desired use case: (<description>: <decimal value>)
(IE: to hide just the C drive, enter a value of 4)- Do not restrict drives: 0
- Restrict A and B drives only: 3
- Restrict C drive only: 4
- Restrict D drive only: 8
- Restrict A, B and C drives only: 7
- Restrict A, B, C and D drives only: 15
- Restrict all drives: 67108863 (this setting will also prevent drive redirection from the local computer to the target device within a PSM session, e.g. in WinSCP)
- Note: Other values can be used, but these are the default ones provided by the policy setting in Group Policy
- A non default setting successfully tested is to restrict A, B, C, D, and E drives only, with a NoDrives value of 31
- Note: online NoDrive Calculator at http://www.wisdombay.com/hidedrive/
- New Calculator found here https://ss64.com/nt/syntax-nodrives.html
- Click OK
- Unload the Default User Registry Hive
- Select defaultuser under HKEY_LOCAL_MACHINE
- Click (File – Unload Hive)
- Close RegEdit
- Delete existing PSM Shadow User profiles
- From a Run prompt run control sysdm.cpl
- Select the Advanced tab
- In the User Profiles section, select Settings
- Select Shadow User Profile (<computername\PSM-<unique number)
- Click Delete
- Repeat d & e until all desired shadow user profiles have been deleted
*** The attached "HideLocalDrives.ps1" Powershell script can be used to automate steps 1 - 7 of the above manual process. Script should be used in an elevated powershell prompt.
For usage information type:
get-help .\HideLocalDrives.ps1 -detailed