Change Pagefile Settings from Custom to System Managed using PowerShell



To change the pagefile settings to system managed, we need to set InitialSize and MaximumSize parameters to 0. In the below example, we have E: has custom pagefile, not system managed and we need to convert it to the system managed.

$pagefileset = Gwmi win32_pagefilesetting | where{$_.caption -like 'E:*'}
$pagefileset.InitialSize = 0
$pagefileset.MaximumSize = 0
$pagefileset.Put() | Out-Null

Now when you check the pagefile setting on E: it should be System managed.

To change the settings on the remote computer use -ComputerName parameter in the Get-WmiObject method.

Updated on: 2020-10-05T11:20:44+05:30

822 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements