大网数据广告活动
Windows排障命令

gpfixup

· 52CE 我爱测

Reference article for the gpfixup command, which fixes domain name dependencies in Group Policy Objects and Group Policy links after a domain rename operation.

Fixes domain name dependencies in Group Policy Objects and Group Policy links after a domain rename operation. To use this command, you must install Group Policy Management as a feature through Server Manager.

Syntax

gpfixup [/v]
[/olddns:<olddnsname> /newdns:<newdnsname>]
[/oldnb:<oldflatname> /newnb:<newflatname>]
[/dc:<dcname>] [/sionly]
[/user:<username> [/pwd:{<password>|*}]] [/?]

Parameters

Parameter Description
/v Displays detailed status messages. If this parameter isn't used, only error messages or a summary status message stating, SUCCESS or FAILURE appears.
/olddns:<olddnsname> Specifies the old DNS name of the renamed domain as <olddnsname> when the domain rename operation changes the DNS name of a domain. You can use this parameter only if you also use the /newdns parameter to specify a new domain DNS name.
/newdns:<newdnsname> Specifies the new DNS name of the renamed domain as <newdnsname> when the domain rename operation changes the DNS name of a domain. You can use this parameter only if you also use the /olddns parameter to specify the old domain DNS name.
/oldnb:<oldflatname> Specifies the old NetBIOS name of the renamed domain as <oldflatname> when the domain rename operation changes the NetBIOS name of a domain. You can use this parameter only if you use the /newnb parameter to specify a new domain NetBIOS name.
/newnb:<newflatname> Specifies the new NetBIOS name of the renamed domain as <newflatname> when the domain rename operation changes the NetBIOS name of a domain. You can use this parameter only if you use the /oldnb parameter to specify the old domain NetBIOS name.
/dc:<dcname> Connect to the domain controller named <dcname> (a DNS name or a NetBIOS name). <dcname> must host a writable replica of the domain directory partition as indicated by one of the following:<ul><li>The DNS name <newdnsname> by using /newdns</li><li>The NetBIOS name <newflatname> by using /newnbIf this parameter isn't used, you can connect to any domain controller in the renamed domain indicated by <newdnsname> or <newflatname>.</li></ul>
/sionly Performs only the Group Policy fix that relates to managed software installation (the Software Installation extension for Group Policy). Skip the actions that fix Group Policy links and the SYSVOL paths in GPOs.
/user:<username> Runs this command in the security context of the user <username>, where <username> is in the format domain\user. If this parameter isn't used, this command runs as the logged in user.
/pwd:`{<password> *}`
/? Displays Help at the command prompt.

Examples

This example assumes that you have already performed a domain rename operation in which you changed the DNS name from MyOldDnsName to MyNewDnsName, and the NetBIOS name from MyOldNetBIOSName to MyNewNetBIOSName.

In this example, you use the gpfixup command to connect to the domain controller named MyDcDnsName and repair GPOs and Group Policy links by updating the old domain name embedded in the GPOs and links. Status and error output is saved to a file that is named gpfixup.log.

gpfixup /olddns: MyOldDnsName /newdns:MyNewDnsName /oldnb:MyOldNetBIOSName /newnb:MyNewNetBIOSName /dc:MyDcDnsName 2>&1 >gpfixup.log

This example is the same as the previous one, except that it assumes the NetBIOS name of the domain was not changed during the domain rename operation.

gpfixup /olddns: MyOldDnsName /newdns:MyNewDnsName /dc:MyDcDnsName 2>&1 >gpfixup.log

Related links

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). 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 / Windows Server documentation
适用范围
Windows Server · Source date 10/16/2017
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

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

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