Hello
Thanks for posting in Microsoft Community.
- Create a new user profile directory on D: drive
First, you need to make sure that the folder where the user profile is stored exists on the D: drive. You can create the folder manually or use a PowerShell script.
To create the directory manually:
Open File Explorer.
Go to the D: drive and create a folder called Users.
Path: D:\Users
To create the folder using PowerShell:
New-Item -Path "D:\Users" -ItemType Directory
Make sure the folder has the appropriate permissions so that all users can read and write data to it
- Configure Group Policy to redirect user profiles
You can configure the user profile storage path through Group Policy. Follow these steps:
a. Open the Group Policy Management Console (GPMC)
Open Server Manager on the server.
Go to Tools > Group Policy Management.
In the left pane, expand your domain, then right-click Default Domain Policy (or create a new policy if necessary), and select Edit.
b. Modify the user profile path setting
In the Group Policy Management Editor, navigate to:
Computer Configuration > Administrative Templates > System > User Profiles
Find the setting called "Set roaming profile path for all users who log on to this computer" and double-click to open it.
Set to Enabled and enter the new user profile storage path:
D:\Users%username%
Description: The %username% variable ensures that each user's profile is stored in a subdirectory named after their username (for example, D:\Users\JohnDoe).
c. Apply the policy
Close the Group Policy Editor.
To force an update of Group Policy:
Open a Command Prompt (with Administrator privileges) and run the following command:
gpupdate /force
The next time the user logs on, the profile will be stored in the newly specified path.
- Verify Profile Redirection
After configuring the Group Policy, ensure that the profile is successfully created on the D: drive after the user logs on:
Have a user log on.
Check that the user's profile is created in the D:\Users\ folder.
You can also verify that the USERPROFILE environment variable correctly points to the new profile path by running the following command:
set USERPROFILE
I hope the above information is helpful to you.
Best regards
Runjie Zhai