You can script the placement of the Windows page file in your SCCM Task Sequence. Sure you could use the good old wmic pagefileset but we’re in 2014, Powershell is your new friend!
SCCM Task Sequence Page File Location Script
My clients needed a script that :
- Disable page file on OS drive
- Move it to D:
- Set the page file based on the allocated memory installed (x1.5)
I used a Powershell module found here.
My Script then uses a function of this modules to fits my needs. Save this script in a .ps1 file.
#Reads the physical memory and multiplies it by 1.5
$PageFileSizeMB = [Math]::Truncate(((Get-WmiObject Win32_ComputerSystem).TotalPhysicalMemory) / 1MB) * 1.5
#Sets a Page File of 1.5 * Installed Physical Memory on D: drive
Set-OSCVirtualMemory -InitialSize $PageFileSizeMB -MaximumSize $PageFileSizeMB -DriveLetter “D:”
#Disable page file on C: drive
Set-OSCVirtualMemory -None -DriveLetter “C:”
#–end—
**You can change the values for the drives and the size of the page file.
For the SCCM part :
- Create a package containing both the .psm1 module and YourScript.ps1
- Replicate to your DP
- Create a “Run Command Line” in your Task Sequence. Rename it to “Copy Set Page File Script Locally”
- Command : xcopy.exe .\*.* C:\OSDPageFile /s /i /y
- Point to your previously created package
- Create a “Run Command Line” in your Task Sequence. Rename it to “Set Page File”
- Command : powershell -command “import-module C:\OSDPageFile\AdjustVirtualMemoryPagingFileSize.psm1; C:\OSDPageFile\SetPageFile.ps1”
- Place the steps in your customization steps (usually near the end of the TS)
Verify in Windows once the TS completes. You SCCM Task Sequence Page File Location should be changed
yimesgen
05.26.2017 AT 03:56 PMJean-Sebastien
03.03.2016 AT 11:53 AMBruce
10.05.2015 AT 11:13 PMBenoit Lecours
10.09.2015 AT 06:37 AMJean-Sebastien
02.09.2016 AT 08:11 AMBenoit Lecours
02.09.2016 AT 10:25 AMJag Nagra
12.08.2014 AT 03:20 AM