PCOnboarding

PC Onboarding Application

PowerShell-based onboarding tool. Asks a few questions up front, then runs:

  1. Optionally rename the PC, and join it to Microsoft Entra ID, an Active Directory domain, or both (chosen at startup — see Rename and join).
  2. Detect and remove all Microsoft Office installations.
  3. Detect and remove preloaded/consumer Teams and the new Outlook app. OneDrive is intentionally left in place.
  4. Detect and remove preloaded McAfee products, then run McAfee’s own MCPR removal tool to clear what their uninstallers leave behind.
  5. Download and silently install Google Chrome Enterprise.
  6. Download and silently install Adobe Acrobat Reader.
  7. Optional apps — off by default, only installed if you say yes at the startup prompts: Dropbox, Slack, Google Drive, Cisco Secure Client.

Quick start on a new PC

In PowerShell:

iwr https://git-pc.skjenkins.com/PCOnboarding.zip -OutFile $env:TEMP\PCOnboarding.zip
Expand-Archive $env:TEMP\PCOnboarding.zip -DestinationPath C:\PCOnboarding -Force
C:\PCOnboarding\Run-Onboarding.cmd

Approve the admin (UAC) prompt if one appears. The window stays open after the run so you can read the summary.

PCOnboarding.zip is rebuilt automatically from main on every push (see .github/workflows/pages.yml), so the link always has the latest version.

Ticket summary

When the run finishes, the script prints a summary ready to paste into a ticket, copies it to the clipboard, and saves it as Logs\Summary_<timestamp>.txt:

PC Onboarding Summary - CONTOSO-LT01 (renamed from DESKTOP-ABC123)
Start Time: 9/24/2026 2:05 PM
End Time:   9/24/2026 2:41 PM
Runtime:    45 min (actual 36 min, rounded up to 15-min increments)

Joined:
  - Domain: contoso.local
  - Microsoft Entra ID (hybrid): completes after restart
Removed (5):
  - Microsoft 365 - en-us
  - Microsoft Teams (new)
  - ...
Installed (2):
  - Google Chrome Enterprise
  - Adobe Acrobat Reader
Failed (1):
  - Remove Microsoft OneNote - pt-br

Structure

Usage

Run on the target Windows PC (requires admin — the script will self-elevate via UAC if not already running elevated):

powershell.exe -ExecutionPolicy Bypass -File .\Start-Onboarding.ps1

Dry run (detect only, no removal):

powershell.exe -ExecutionPolicy Bypass -File .\Start-Onboarding.ps1 -WhatIf

Skip the interactive MCPR cleanup (the silent McAfee uninstalls still run):

powershell.exe -ExecutionPolicy Bypass -File .\Start-Onboarding.ps1 -SkipMcprCleanup

At startup it first asks whether to rename the PC, then how to join it:

Rename this PC? Current name is DESKTOP-ABC123. Enter a new name, or press Enter to keep it

How should this PC be joined?
  1) Microsoft Entra ID (Entra joined)
  2) Active Directory domain (domain joined)
  3) Both - domain join, then hybrid Entra join
Enter 1, 2, or 3 (or just press Enter to skip joining)

Options 2 and 3 then ask for the domain name and pop up a sign-in box for an account that’s allowed to join computers to it. Then it asks:

Also install any optional apps (Dropbox, Slack, Google Drive, Cisco Secure Client)? (y/N)

Answer N (or just press Enter) to run only the default set. Answer y and it asks about each app in turn:

  Install Dropbox? (y/N)
  Install Slack? (y/N)
  Install Google Drive? (y/N)
  Install Cisco Secure Client? (y/N)
    Path to the Cisco Secure Client installer (.msi)

The Cisco path prompt only appears if you said yes to Cisco Secure Client, and re-asks until you give it a file that actually exists.

Aside from that startup Q&A, only two things can need someone at the keyboard: an Entra join (option 1), which happens in step 1 right after the questions, and the MCPR cleanup in step 4, only if McAfee was actually found (MCPR is a CAPTCHA-gated wizard; pass -SkipMcprCleanup to skip it). A failed domain join also asks whether to retry. Everything else runs unattended, with progress shown via a progress bar and console output, and a full transcript written to Logs\.

Rename and join (step 1)

Runs before anything is uninstalled.

Rename: new names must be 1–15 letters, numbers, or hyphens, not all numbers, and can’t start or end with a hyphen; the prompt re-asks until the name is valid. The new name takes effect after restart, and the ticket summary shows it as NEW-NAME (renamed from OLD-NAME).

Join: Windows Home can’t be joined to a domain or Entra ID, so the script checks the edition first and reports it as failed on Home PCs (upgrade to Pro, then join); a rename still works on Home. It also skips any join the PC already has.

The domain account password goes only to Add-Computer; it isn’t written to the log or the ticket summary. When a rename or join was done, the run ends with RESTART REQUIRED.

How detection/removal works

A post-removal re-scan confirms nothing Office-related remains (some leftovers may require a reboot to fully clear, which is called out if seen).

Teams / new Outlook removal (step 3)

These come preloaded on new machines and get replaced once the licensed Microsoft 365 deployment runs, so step 3 clears them out first. OneDrive is deliberately not touched by this step.

Will this stop these from reappearing on user profiles created later? Yes for both. What we remove is the machine-wide provisioning mechanism itself — the Machine-Wide Installer MSI is exactly what installs classic Teams for every new login, and the AppX provisioned package is exactly what installs the new AppX-based Teams/Outlook for every new login. Removing them removes that trigger, so future profiles won’t get it either.

McAfee removal (step 4)

McAfee ships preloaded on most consumer/OEM machines as a trial, usually as several separate entries rather than one. Removal is two stages, because in practice one isn’t enough.

Stage 1 — silent uninstall of each detected product. Detection scans the same registry Uninstall keys used elsewhere in this project, matching on either display name (McAfee, WebAdvisor, Safe Connect, LiveSafe, Total Protection) or publisher (McAfee). The publisher check matters: some OEM preloads register components like WebAdvisor and Safe Connect without the McAfee brand anywhere in the display name, so a name-only scan misses them. The Store-delivered “McAfee Security” app is picked up separately via Get-AppxPackage -AllUsers / Get-AppxProvisionedPackage -Online, same pattern as OneNote and Teams above — the provisioned copy is what reinstalls it for every new user profile, so it has to go too.

Products are removed in dependency order: the bolt-on components first, the main suite (Total Protection / LiveSafe / Internet Security / Antivirus / Personal Security) last. Taking the suite out first leaves its bolt-ons holding a dead uninstall string and they become unremovable without manual cleanup. Entries with a GUID-shaped key go to msiexec /x ... /qn /norestart; the rest run their own recorded uninstall string, preferring QuietUninstallString when the product registered one, and otherwise having /quiet appended if no silence flag is already present.

Stage 2 — MCPR. McAfee’s own uninstallers routinely strand services, drivers and registry keys that block a later clean reinstall, so MCPR (McAfee Consumer Product Removal) runs as a cleanup pass whenever McAfee was detected — even if every uninstall in stage 1 reported success.

MCPR is interactive. It’s a wizard and it gates itself behind a CAPTCHA, so it cannot be silenced and it will stall an unattended run waiting for clicks. That’s why it’s a cleanup pass rather than the primary removal path, and why -SkipMcprCleanup exists. A reboot is required afterwards to finish clearing McAfee’s drivers and services.

Where MCPR is downloaded from

Straight from McAfee’s CDN:

https://download.mcafee.com/products/licensed/cust_support_patches/MCPR.exe

Older removal guides circulate a shortened alias, mcpr.notlong.com. That alias is deliberately not used here, even though it currently 302s to exactly the URL above and serves a byte-identical file (12,647,224 bytes, verified). The reason is control: mcpr.notlong.com and bare notlong.com resolve to the same third-party host, so it’s a wildcard redirector someone else owns and can repoint at any binary at any time — and this script executes whatever comes back, elevated. Fetching from McAfee directly gets the same file with nobody in the middle.

As a second layer, Invoke-McAfeeRemovalTool checks the downloaded file’s Authenticode signature before running it, and refuses to execute unless the signature is valid and the signing subject is McAfee. If the URL ever starts serving something else, the script fails there instead of running it.

App installs (steps 5 & 6)

Both apps are downloaded to %ProgramData%\PCOnboarding\Downloads and installed silently — no prompts, no bundled-offer opt-outs to click through.

Both installer functions download with Invoke-WebRequest, verify a non-empty file landed before proceeding, and treat MSI exit codes 0 and 3010 (success, reboot required) as success.

Optional apps (step 7) — off by default

None of these run unless you answer yes to them at the startup prompts (see Usage above). All three downloadable ones land in %ProgramData%\PCOnboarding\Downloads, same as Chrome/Adobe.

Notes / next steps