Hello
To automate the quota assignment for a user's personal folder on a File Server (FS) running Windows Server 2019 when they log in for the first time on their Windows 11 workstation, you can use a combination of Group Policy, PowerShell scripts, and Task Scheduler. Here's a step-by-step guide to achieve this:
1.Create a PowerShell Script: Write a PowerShell script that assigns the quota to the user's personal folder. Save this script on a shared location accessible by all users.
Define the path to the user's personal folder
$userFolder = "\FS\Users$env:USERNAME"
Define the quota template name
$quotaTemplate = "YourQuotaTemplateName"
Assign the quota to the user's personal folder
New-FsrmQuota -Path $userFolder -Template $quotaTemplate
2.Create a Group Policy Object (GPO): Create a new GPO that will run the PowerShell script when the user logs in.
Open the Group Policy Management Console (GPMC).
Create a new GPO and link it to the appropriate Organizational Unit (OU) where your users are located.
Edit the GPO and navigate to User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff).
Add the PowerShell script to the Logon scripts.
3.Configure Task Scheduler: Use Task Scheduler to ensure the script runs with the necessary permissions.
Open Task Scheduler and create a new task.
Set the task to run with the highest privileges.
Set the trigger to run at user logon.
In the Actions tab, set the action to start a program and point it to powershell.exe with the script path as an argument.
4.Deploy the GPO: Ensure the GPO is applied to the users. You can use the gpupdate /force command to force the policy update.
5.Test the Setup: Log in with a test user account to verify that the quota is assigned correctly to the user's personal folder.
By following these steps, you can automate the quota assignment process for users' personal folders on the File Server when they log in for the first time on their Windows 11 workstations.
I hope the information above is helpful.
Best Regards,
Yanhong Liu
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.