locked
Inconsistent Win32_PageFileSetting RRS feed

  • Question

  • I have been having inconsistent results when I issue the command

    Get-WmiObject -Class Win32_PageFileSetting

    It works on some computers, but others it returns nothing. 

    Is there some other configuration that needs to be done before issuing this command in order to consistently get the information?

    I have not gotten it to run on any VM yet.  But it seems to work on any server-class physical system on which I have installed Windows Server 2012 R2.  Strangely, I have one desktop that I use as a lab machine.  It has 2012 R2 installed and it returns nothing.  It's the only physical server I have tried that returns nothing.

    Any ideas?


    . : | : . : | : . tim

    Thursday, April 23, 2015 7:02 PM

Answers

  • Windows Vista and later have system managed page files by default.  They are not listed as they are dynamic.


    \_(ツ)_/

    • Marked as answer by Tim CerlingMVP Thursday, April 23, 2015 10:59 PM
    Thursday, April 23, 2015 9:59 PM

All replies

  • Windows Vista and later have system managed page files by default.  They are not listed as they are dynamic.


    \_(ツ)_/

    • Marked as answer by Tim CerlingMVP Thursday, April 23, 2015 10:59 PM
    Thursday, April 23, 2015 9:59 PM
  • That was it. I forgot that on the system on which it worked, I had already manually changed the pagefile, something I always do on my Hyper-V hosts because of the amount of memory on them.

    The other part in my script was I was forgetting the .Put() after setting the automatic value to $false so when I tried to retrieve the settings to reset them, there was still nothing there.  This now works.

    #  Set automanage pagefile to false; min/max pagefile size
    $computerSystem = Get-WmiObject -Class Win32_ComputerSystem -EnableAllPrivileges
    $computerSystem.AutomaticManagedPagefile = $false
    $computerSystem.Put() | Out-Null
    
    $pageFileSetting = Get-WmiObject -Class Win32_PageFileSetting
    $pageFileSetting.InitialSize = 1024
    $pageFileSetting.MaximumSize = 4096
    $pageFileSetting.Put() | Out-Null
    
    Thanks for the guidance.


    . : | : . : | : . tim

    Thursday, April 23, 2015 10:59 PM