Hide PSM Local Drives

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
PAM Self-Hosted Articles
5 min read
L3 Networker
No ratings

Question

How can I hide the PSM Local Drives from PSM Shadow Users when using WinSCP or other applications?

Answer

Change the policy in the Default User profile so that the desired drives are hidden recreate the Shadow User profiles

Manual Process:

  1. In Regedit, load the Default User registry hive
    1. Launch Regedit.exe
    2. Select HKEY_LOCAL_MACHINE in the left window pane
    3. Select (File – Load Hive)
    4. In the load hive dialog select or type “C:\Users\Default\NTUSER.DAT” and click Open
    5. In the second load hive dialog enter “defaultuser” for Key Name and click OK
  2. Expand the Registry to the CurrentVersion Key
    1. Expand HKEY_LOCAL_MACHINE
    2. Expand defaultuser
    3. Expand Software
    4. Expand Microsoft
    5. Expand Windows
    6. Expand CurrentVersion
  3. Look for the Policies key under CurrentVersion. If it does not exist, create it. If it does exist Expand it.
    1. Right-click CurrentVersion
    2. Select (New – Key)
    3. Enter Policies for the name of the key
  4. Look for the Explorer key under Policies. If it does not exist, create it. If it does exist, Select it.
    1. Right-click CurrentVersion
    2. Select (New – Key)
    3. Enter Explorer for the name of the key
  5. Create a new DWORD Value with the name NoDrives
    1. Right-click Explorer
    2. Select (New – DWORD (32-bit) Value
    3. Enter NoDrives for the name of the value
  6. Set the value of NoDrives
    1. Double-Click NoDrives
    2. Under Base, select the Decimal radio button
    3. 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 
    4. Click OK
  7. Unload the Default User Registry Hive
    1. Select defaultuser under HKEY_LOCAL_MACHINE
    2. Click (File – Unload Hive)
    3. Close RegEdit
  8. Delete existing PSM Shadow User profiles
    1. From a Run prompt run    control sysdm.cpl
    2. Select the Advanced tab
    3. In the User Profiles section, select Settings
    4. Select Shadow User Profile (<computername\PSM-<unique number)
    5. Click Delete
    6. 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


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:

  1. In Regedit, load the Default User registry hive
    1. Launch Regedit.exe
    2. Select HKEY_LOCAL_MACHINE in the left window pane
    3. Select (File – Load Hive)
    4. In the load hive dialog select or type “C:\Users\Default\NTUSER.DAT” and click Open
    5. In the second load hive dialog enter “defaultuser” for Key Name and click OK
  2. Expand the Registry to the CurrentVersion Key
    1. Expand HKEY_LOCAL_MACHINE
    2. Expand defaultuser
    3. Expand Software
    4. Expand Microsoft
    5. Expand Windows
    6. Expand CurrentVersion
  3. Look for the Policies key under CurrentVersion. If it does not exist, create it. If it does exist Expand it.
    1. Right-click CurrentVersion
    2. Select (New – Key)
    3. Enter Policies for the name of the key
  4. Look for the Explorer key under Policies. If it does not exist, create it. If it does exist, Select it.
    1. Right-click CurrentVersion
    2. Select (New – Key)
    3. Enter Explorer for the name of the key
  5. Create a new DWORD Value with the name NoDrives
    1. Right-click Explorer
    2. Select (New – DWORD (32-bit) Value
    3. Enter NoDrives for the name of the value
  6. Set the value of NoDrives
    1. Double-Click NoDrives
    2. Under Base, select the Decimal radio button
    3. 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 
    4. Click OK
  7. Unload the Default User Registry Hive
    1. Select defaultuser under HKEY_LOCAL_MACHINE
    2. Click (File – Unload Hive)
    3. Close RegEdit
  8. Delete existing PSM Shadow User profiles
    1. From a Run prompt run    control sysdm.cpl
    2. Select the Advanced tab
    3. In the User Profiles section, select Settings
    4. Select Shadow User Profile (<computername\PSM-<unique number)
    5. Click Delete
    6. 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

 

Rate this article:
  • 16739 Views
  • 0 comments
  • 0 Likes
Article Dashboard
Version history
Last Updated:
‎08-04-2020 09:52 AM
Updated by: