Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:24:58+00:00 2026-06-18T06:24:58+00:00

On server 2008 R2 i programatically set the CPU LIMIT to a certain percentage

  • 0

On server 2008 R2 i programatically set the CPU LIMIT to a certain percentage with the following PowerShell

function Set-UserAccountCPUThrottle
{
[CmdletBinding()]
Param(
[ValidateNotNullOrEmpty()]
[parameter(Mandatory = $true)]
$UserNameToRestrict,
[Parameter(Mandatory = $false)]
[int]$CpuPercentage = 5
)

write-host "about to restrict user account $UserNameToRestrict to use ${CpuPercentage}% CPU"

  try
    {     
      $objUser = New-Object System.Security.Principal.NTAccount($UserNameToRestrict)
      $local:ResolvedSID= $objUser.Translate([System.Security.Principal.SecurityIdentifier]).Value.trim()   
    }
  catch
    {
      throw "Cannot resolve the User (or find its SID) for $UserNameToRestrict"
    }    
 $regpath = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Quota System\${local:ResolvedSID}"
 #in creating a new key for this sid, it will remove any old item
mkdir $regpath -Force -ErrorAction stop | out-null
#as the old key if existing was removed by the above code, this will create a new value
 New-ItemProperty -Path $regpath  -Name "CpuRateLimit" -Value $CpuPercentage -PropertyType "DWord" -Force -ErrorAction stop | out-null   

}

However while this does create the registry key per http://technet.microsoft.com/en-us/library/ff384148(v=ws.10).aspx

it has null effect on server 2012 or windows 8. Is this broken or is there a new way to do this in server 2012?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:24:59+00:00Added an answer on June 18, 2026 at 6:24 am

    According to this page on TechNet, resource management is not enforced unless the total CPU usage is greater than 70%.

    Is your machine that busy? That page also describes a few other cases where resource management may not occur.

    You didn’t mention precisely what you are trying to control. If your workload is RDS (virtual desktops, session-based desktops or RemoteApp programs), the Windows Server 2012 “FairShare” feature might be more useful to you. Relevant snippet:

    “Fairshare of resources in RD Session Host. In Windows Server 2012,
    RD Session Host server allocates CPU, Disk I/O, and Network I/O such
    that a single user cannot consume resources that would negatively
    impact other users on the same host. Each user will get a “fair
    share”. This is done with minimum overhead so the CPU, disk, and
    network resources are used to maximum capacity.”

    That snippet can be found about midway down this technet page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SQL server 2008 on WINDOWS 2008 Please compare following sqls: 1. select count(*) from
I have a SQL Server 2008 R2 table with the following Schema DECLARE @AttributeTable
SQL Server 2008 Profiler always profiles all databases. I want to restrict profiling or
SQL Server 2008 Database Question. I have 2 tables, for arguments sake called Customers
SQL Server 2008 is telling me to include the Primary Key in an index
SQL server 2008 Hello here is my query which returns the result SELECT *
Using SQL Server 2008 R2 we are looking for a way to select the
I am using SQL Server 2008 R2, I have a script to update the
Using SQL Server 2008. I have multiple Locations which each contain multiple Departments which
I am using SQL Server 2008 R2 and my stored procedure takes in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.