Configuring Virtual Memory with either GPO or script

Hello All,

Is there a setting in group policy to set virtual memory sizes on desktops in a domain? If not, does anyone know of a good script to do the same?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can have the group policy for users to able to change the virtual memory or not. But not the size. You have to set size under system properties. It can be set under here: Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment
richardmosesAuthor Commented:
Are you saying I CAN set the size under Computer Configuration? Or only the ability for a user to do it?
I found this script in MS script center to change the size of a Page File. You can use this to set GPO

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

The first reply is for user ability to change the virtual memory.
Like Star_trek said,

However, this should remain the default of "Let windows control virtual memory".

Messing with it across the board could cause some workstations to have too much or not enough virtual memory if you set it statically.

For instance if you set it to 768MB, and the workstation has 2GB of RAM (say an autocad machine), then 768MB isn't enough VM.

Vice versa, if you set it to 768MB and the workstation has 128MB of memory, that's just wasted space really.
richardmosesAuthor Commented:
I agree with not setting it statically across the board. My question is that if I set the policy to prevent users from customizing it, will it default it back to windows management even if they have already customized it?

For example, User1 sets his own virtual memory to 768mb.
Policy is put in place on his machine to not allow changes.
Does the 768mb setting stay, or does it go away?
Well, the GPO would be using the "script" that Star_Trek posted in it, so it would always run and change the page file back to what you would be statically setting.

Problem lies in that you aren't taking into account if they decide to move the pagefile to D: or something.  In that case the script would error out based on what it says currently (because it looks for C:\pagefile.sys)

If you are concerned about users changing it from the default, then the easiest way is to create a GPO that uses the:

user config >> admin templates >> desktop >> remove properties from the My computer context menu

and if you want to go even further, set the "Hide Specified control panel applets" under admin templates > control panel, and add sysdm.cpl

This will basically prevent any user that the GPO applies to (be careful that IT or users you need to have system panel access aren't in that OU), from being allowed into the My computer, properties, tabs.  Then they won't have the ability to change it via GUI.

Now obviously if they really really want it changed, they can script it, etc. if they are admins on the local machine....but this would handle 99% of cases.
richardmosesAuthor Commented:
So I would need to use the script to set it then?

Hope I'm not being completely ignorant here....
Use the script if you want to set it statically to something other than the default (which is Let windows decide).  The script is really designed as a local script, meaning that there aren't enough error corrections and input into it to take into account everyone in an organization.

I would leave the default myself, and just enable the settings I posted in the last post if you really want to disable them from getting to those settings.  Just remember that they won't be able to reach any of the tabs under My computer, properties.  If that's not a problem though, then go for it.

I would test it on a test OU, see if you like it, let management agree, then go forward with it in production.
I agree with TheCleaner, first try in test bed and if it works only then move it to production. 'Cos If the value you set is lower value than what it needs can be a problem, unless all your machines are similar.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.