# Print test page on default printer

**URL:** <https://forums.powershell.org/t/print-test-page-on-default-printer/26397>\
**Category:** PowerShell Help\
**Created:** [May 19, 2026, 6:55pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397 "2026-05-19T18:55:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkoop](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kkoop](https://forums.powershell.org/u/kkoop)\
**Post date:** [May 19, 2026, 6:55pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397/1 "2026-05-19T18:55:55Z")

</div>

I thought this would be simple, but apparently not. I would like to send a test page to the default printer on the workstation I’m logged into. It should be the same test page I would get if I opened Printers and Scanners, opened the default printer, clicked “print test page”.

I’ve seen some examples where I can specify a printer name, but I would like the script to always go to what printer is configured as the workstation’s default, so that I can just run it to confirm where the print job shows up.

Suggestions?

—K

---

<div class="post-metadata">

**Author:** ![RichMath](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@RichMath](https://forums.powershell.org/u/RichMath)\
**Post date:** [May 19, 2026, 7:20pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397/2 "2026-05-19T19:20:09Z")

</div>

Give this a try:

```PowerShell
(Get-CimInstance Win32_Printer -Filter "Default = TRUE").PrintTestPage()

```

---

<div class="post-metadata">

**Author:** ![kkoop](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kkoop](https://forums.powershell.org/u/kkoop)\
**Post date:** [May 20, 2026, 12:17pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397/3 "2026-05-20T12:17:18Z")

</div>

Thanks, Rich! Tried the code, but got this

> PS P:\> (Get-CimInstance Win32\_Printer -Filter “Default = TRUE”).PrintTestPage()  
> Method invocation failed because  
> [Microsoft.Management.Infrastructure.CimInstance] does not contain a  
> method named ‘PrintTestPage’.  
> At line:1 char:1
> 
> - (Get-CimInstance Win32\_Printer -Filter “Default = TRUE”).PrintTestPag  
> …

Did I miss something?

—K

---

<div class="post-metadata">

**Author:** ![psdarwin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/psdarwin/32/2063_2.png) [@psdarwin](https://forums.powershell.org/u/psdarwin)\
**Post date:** [May 20, 2026, 1:20pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397/4 "2026-05-20T13:20:45Z")

</div>

```auto
Get-CimInstance Win32_Printer -Filter "Default = TRUE" | Invoke-CimMethod -MethodName PrintTestPage

```

At least for me this had to be run in an elevated PS session

---

<div class="post-metadata">

**Author:** ![kkoop](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kkoop](https://forums.powershell.org/u/kkoop)\
**Post date:** [May 20, 2026, 1:43pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397/5 "2026-05-20T13:43:30Z")

</div>

Thank you, Darwin!! Worked perfectly for me, two workstations, two non-admin users.

It’s funny. in the interim I tapped AI to write something, and it returned 35 lines of code to do just this.

It seems we may not be in as much danger as the hype-crowd would like us to stress about.

Much appreciated!

—K

---

<div class="post-metadata">

**Author:** ![RichMath](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@RichMath](https://forums.powershell.org/u/RichMath)\
**Post date:** [May 20, 2026, 3:44pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397/6 "2026-05-20T15:44:34Z")

</div>

If the printer is installed for “all users” (i.e., it’s a “system level” device) it needs elevation. If the printer is installed for a specific user and that user runs the code, elevation isn’t needed.

---

<div class="post-metadata">

**Author:** ![kkoop](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kkoop](https://forums.powershell.org/u/kkoop)\
**Post date:** [May 20, 2026, 7:08pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397/7 "2026-05-20T19:08:22Z")

</div>

That must be the reason. I run a short PS script install the printer and make it default.

It runs under the user’s profile, so that follows.

Thanks, again!

—K

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [June 19, 2026, 7:09pm UTC](https://forums.powershell.org/t/print-test-page-on-default-printer/26397/8 "2026-06-19T19:09:01Z")

</div>

Closed on June 19, 2026, 7:09pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
