大网数据广告活动
域与目录服务

Printer Preferences can't set default printer

· 52CE 我爱测

Works around an issue where Group Policy Printer Preferences fails to set the default printer.

This article provides a workaround for an issue where Group Policy Printer Preferences fails to set the default printer.

Original KB number:   2787598

Symptoms

Using Group Policy Preferences to create a new printer mapping and set that printer as the default printer fails on Windows Vista and higher clients when the user is logging on for the first time. The printer mapping is successfully created, but is not set as the default printer in the registry. A printer preferences trace shows the following error:

<VALUE>The printer name is invalid.</VALUE></PROPERTY>-</INSTANCE>
Event ID 4098 is logged in the Application Log:
Log Name: Application
Source: Group Policy Printers
Date: <DateTime>
Event ID: 4098
Task Category: (2)
Level: Warning
Keywords: Classic
User: SYSTEM
Computer: server.fabrikam.com
Description:
The user 'HP Printer' preference item in the 'Define Printers {XXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}' Group Policy object did not apply because it failed with error code '0x80070709 The printer name is invalid.' This error was suppressed.

Cause

Group Policy Preferences creates the network printer mapping and calls the SetDefaultPrinterW() API before the user logon completes. At this point, the network connection under Software\Microsoft\Windows NT\CurrentVersion\Devices is not created yet. So when it calls the SetDefaultPrinterW() API, it fails with the error code 0x80070709 "The printer name is invalid."

The printer connection registry values will only be created by the Spooler Service when it receives the SERVICE_CONTROL_SESSIONCHANGE notification. This notification message will only be sent AFTER the user logon completes. So when Group Policy Preferences calls SetDefaultPrinterW() the first time, the default printer will not be set.

Resolution

There is currently no hotfix available for this issue. Possible work-arounds include:

  1. Force a group policy update after logon using the GPUPDATE /FORCE command
  2. Restart the Print Spooler (spooler) service after user logon
  3. Use a Scheduled Task to run a script after logon to define the default printer
  4. Use Registry Preferences to configure the default printer

Data collection

If you need assistance from Microsoft support, we recommend you collect the information by following the steps mentioned in Gather information by using TSS for User Experience issues.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- Supported versions of Windows Server · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。