remote quota assignment. automation.

Mario 300 Reputation points
2024-11-20T23:59:54.6+00:00

Having a quota template already created in a FS, and in the same FS there is the user's personal folder created.

How can I automate the quota assignment, when the user logs in for the first time in his Workstation (win11) and already has access to his personal folder hosted in the FS (win2019)

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,848 questions
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,906 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,478 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,584 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yanhong Liu 13,835 Reputation points Microsoft Vendor
    2024-11-21T08:24:01.4133333+00:00

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.