Windows Core: Move Page File via PowerShell

Reading Time: < 1 minute

You have configured a Windows Core Server and the page file resides on disk C. You would like to move it to Disk P

Run the below commands one at a time. If copying and pasting the commands, you may need to reenter the ” if any of the commands error.
Also, if you receive Description = Invalid query when running command 2, please reboot your server and run all commands again.
1)
wmic computersystem set AutomaticManagedPagefile=False

2)
wmic pagefileset where name=”C:\\pagefile.sys” delete

3)
wmic pagefileset create name=”P:\pagefile.sys”

4) Amend the InitialSize and MaximumSize figures as required. This command is based on a server including 4GB of memory. If your server includes 4GB of memory, it’s fine to use the below command:

wmic pagefileset where name=”P:\\pagefile.sys” set InitialSize=6144,MaximumSize=6144

5) Reboot the server

6) Run below command to confirm location of your page file
wmic pagefile list /format:list

Windows 2012 Core – How to configure network card using Powershell

Reading Time: < 1 minute
  1. If you have multiple NIC’s you need to identify the name of the NIC. If you’re using a virtual server, disconnect all NICs apart from the one so it can be identified in the next step.
  2. Type Get-NetAdapter
  3. Make a note of your NIC name, for example Ethernet. If you have disconnected all other NICs, Ethernet should be the only one showing as UP
  4. Next, type the below command but amend to your IP address, Gateway and Subnet PreFix LengthNew-NetIPAddress -InterfaceAlias Ethernet -IPAddress 0.0.0.0 -DefaultGateway 0.0.0.0 -PrefixLength 24
  5. Press Enter
  6. To configure DNS entries, the command would be:Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddress 0.0.0.0, 0.0.0.0
  7. Press Enter
  8. Done

Please note, if copying the commands, you may need to reenter – and ” if the commands fail