WMI Query Issue with "ExistingPageFiles" Key RRS feed

  • Question

  • Although this is technically not PowerCLI, the core code uses it to manipulate WMI further down the road.


    I am trying to set the pagefile on all servers from 2008 and above to system on the C: drive only. If I run the following code:

    $a = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges
    $a.AutomaticManagedPagefile = $True

    The code works, and in server 2008 there is now a tickbox for "Automatically manage paging file size for all drives" whereas this feature wasnt available in Server 2003.

    This is where my problem states, the following key is available in server 2008 and above:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\ExistingPageFiles

    However I dont know how to query it via WBEMTEST. Does anyone know where it resides?

    If you run the code above however, and you have 2 separate drives that are custom sized then it simply sets both drives to "system managed" which is greyed out and ticks "Automatically manage paging file size for all drives".

    I cannot seem to find any material that will allow me to probe the ExistingPageFiles registry key directly.

    Any help would be greatly appreciated :)

    Thursday, July 28, 2016 9:41 AM