Skip to content
Menu

New Windows PC Needs the Standard Settings - Apply the MSP Baseline

Checks six settings one by one and fixes only the ones that differ. Nothing is restarted, no user is signed out and no software is installed or removed.

New Windows PC needs the standard settings - apply the MSP baseline is free for members.

Enter your email to create your free account and get the file.

We'll email you the script and the weekly MSP Outpost email. Unsubscribe anytime. Privacy policy.

Already a member? Sign in.

Be the first to review New Windows PC needs the standard settings - apply the MSP baseline. Tell other MSPs how it worked for you.

Write a Review

LanguagePowerShell
Runs onWindows 10, Windows 11; runs as SYSTEM
NeedsPowerShell 5.1, administrator rights
Changes thingsChanges what it runs on

What It Does

This script changes things, but only the settings that differ. It checks the six settings one by one, writes a row for each, and fixes only the ones that are not right. A PC that already matches answers that every baseline setting is already set. Nothing is restarted, no user is signed out and no software is installed or removed.

Time zone is set to TimeZone, a Windows time zone ID such as Pacific Standard Time, and left alone when TimeZone is empty, which is the default. Time sync makes the Windows Time service start automatically and run, sets the sync type to NTP and points it at NtpServer (time.windows.com by default; empty keeps the PC's current server). It is skipped on a domain-joined PC, where the domain controller is the time source. Sleep on AC power sets the active power plan to sleep after SleepOnAcMinutes minutes on mains power, 0 meaning never; the battery setting and the screen timeout are not touched.

Fast Startup is turned off, so Shut down is a full shutdown rather than a half hibernate that keeps pending updates and driver faults alive; it takes effect at the next shutdown. System Restore is switched on for the system drive, and is skipped when a policy disables it. Long file paths are turned on for apps that support them. A setting this PC cannot report, such as the sleep setting on some virtual machines, is skipped with a warning rather than guessed.

Before it changes a registry key it exports that key to the MSPOutpost backup folder under ProgramData, so the old values can be put back with reg import. It does not set region, language or keyboard, which are per user, and it does not remove apps, set the firewall, turn on disk encryption or rename the PC. Those have their own scripts. Servers are skipped, and after a real run it reads each setting back and ends in an error if one did not take.

Before You Run It

  • Run it with DryRun=true on one PC first and read which settings it would change.
  • Set TimeZone, or leave it empty if the PC is already in the right zone. Use the names that tzutil /l lists.
  • Know that the default SleepOnAcMinutes of 0 means the PC never sleeps on mains power. Set a number of minutes, or add sleep-on-ac to SkipSettings, if that is not what you want.
  • Tell users that Fast Startup takes effect at the next shutdown.
  • Run it as an administrator or SYSTEM. Run it again afterwards: it should say that everything is already set.

Type and Risk

  • Type: Action. It makes its change, checks the change worked and says what changed. It exits 0, or 2 when it could not do the job.
  • Risk: Low. Set DryRun=true, or run it with -WhatIf, to list every change without making any.
  • What it changes: Time zone, Windows Time service and time server, sleep on AC power, Fast Startup, System Restore on the system drive, long file paths (registry values, service start type, power plan).
  • Restart: It never restarts the machine.
  • Typical run: Under 30 seconds.
  • Example answer: "Set 3 baseline setting(s): Fast Startup off, Long file paths, Time sync; 3 already set"
  • Tested before listing on Windows 11 with Windows PowerShell 5.1, run as SYSTEM, against its own test cases.

Inputs

Pass an input as an argument (-Name value), as an environment variable with the same name, which is how most RMMs pass script variables, or change its default in the param() block at the top of the script. An argument wins over an environment variable, which wins over the default.

  • TimeZone: Windows time zone ID, for example "Pacific Standard Time" or "Eastern Standard Time". Default empty = leave the time zone alone.
  • NtpServer: Time server host name, for example time.windows.com. Default time.windows.com. Empty keeps the PC's current server and only makes sure the service runs.
  • SleepOnAcMinutes: Minutes of inactivity on AC power before the PC sleeps. Whole number, 0 to 1440; 0 means never. Default 0.
  • SkipSettings: Settings to leave alone, separated by commas: time-zone, time-sync, sleep-on-ac, fast-startup, system-restore, long-paths. Default none.

Every script also takes DryRun, OutputFormat (Text, Answer, Json or Csv), ExportPath and ResultField, which writes the answer to an RMM custom field.

License

Provided "as is" under the MIT License, without warranty of any kind. Test before production use. MSP Outpost and User First Digital Inc. accept no liability for any damage or loss.

The Script

set-windows-pc-baseline.ps1 · 1047 lines · 54.4 KB

Free for Members

Create a free account or sign in to read, copy and download this script.

Welcome Back

Sign in to your MSP Outpost account.