[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# Extend schema\n\nThis document explains how to extend the schema in a Managed Service for Microsoft Active Directory instance.\n\nBefore you begin\n----------------\n\nBefore you begin, do the following:\n\n1. [Create a Managed Microsoft AD domain](/managed-microsoft-ad/docs/create-domain).\n2. [Create and join a Windows VM to the domain](/managed-microsoft-ad/docs/quickstart-domain-join-windows).\n3. Make sure that you read [About schema extension](/managed-microsoft-ad/docs/schema-extension) and understand these [considerations](/managed-microsoft-ad/docs/schema-extension#considerations).\n4. Prepare the LDIF file with the schema changes. For more information, see [How to prepare your LDIF file](/managed-microsoft-ad/docs/schema-extension#prepare-ldif).\n5. Make sure that you have any one of the following Identity and Access Management (IAM) user roles:\n\n - Google Cloud Managed Identities Domain Admin (`roles/managedidentities.domainAdmin`)\n - Google Cloud Managed Identities Admin (`roles/managedidentities.admin`)\n\n For more information, see [Cloud Managed Identities roles](/iam/docs/understanding-roles#cloud-managed-identities-roles).\n\nExtend the schema\n-----------------\n\nWhen you initiate schema extension, Managed Microsoft AD creates a [schema extension backup](/managed-microsoft-ad/docs/backup-restore#overview) automatically before applying the schema changes. You can use this backup to [restore the domain](/managed-microsoft-ad/docs/backup-restore#restore-backup) if you encounter any problems after schema extension. To identify the schema extension backup, you can [list the backups](/managed-microsoft-ad/docs/backup-restore#list-backup) created for your domain.\n\nTo extend the schema, run the following gcloud CLI command: \n\n```\ngcloud active-directory domains extend-schema DOMAIN_NAME --ldif-file=LDIF_FILE_PATH \\\n --description=SCHEMA_EXTENSION_DESCRIPTION --project=DOMAIN_RESOURCE_PROJECT_ID --async\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eDOMAIN_NAME\u003c/var\u003e: The name of your Managed Microsoft AD domain. For example, `my-domain.example.com`.\n- \u003cvar translate=\"no\"\u003eLDIF_FILE_PATH\u003c/var\u003e: The path of the LDIF file with the schema changes. The maximum file size is limited to 1 MB.\n- \u003cvar translate=\"no\"\u003eSCHEMA_EXTENSION_DESCRIPTION\u003c/var\u003e: The description of the schema changes.\n- \u003cvar translate=\"no\"\u003eDOMAIN_RESOURCE_PROJECT_ID\u003c/var\u003e: The project ID of the domain resource project. For example, `my-project`.\n\nManaged Microsoft AD initiates schema extension and responds with an operation ID which you can use to track the completion of schema extension.\n\nTo check the status of your schema extension, run the following gcloud CLI command: \n\n```\ngcloud active-directory operations describe OPERATION_ID\n```\n\nReplace \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e with the operation ID of your schema extension. For example, `operation-1234567890-98765a1b2c3d4e5-e6f7g8-9h0i1j2`.\n\nVerify the schema extension\n---------------------------\n\nAfter you extend the schema of your Managed Microsoft AD instance, it's important you verify the schema changes before integrating your applications with Active Directory. You can verify the schema changes using different tools and approaches. In the following sections, we explain how you can verify the schema changes using any one of these approaches:\n\n1. Active Directory Schema Snap-In\n2. Windows PowerShell\n\n### Active Directory Schema Snap-In\n\nTo verify the schema changes using Active Directory Schema Snap-In, do the following:\n\n1. Login to your domain-joined VM as a delegated administrator.\n2. [Install the **Active Directory Schema Snap-In**](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc732110(v=ws.11)?redirectedfrom=MSDN).\n3. Open the **Microsoft Management Console (MMC)**.\n4. Expand the **Active Directory Schema** tree for your directory.\n5. Verify if you can see the changes in classes and attributes of the schema.\n\n### Windows PowerShell\n\nTo verify the schema changes using Windows PowerShell, use `Get-ADObject` cmdlet. Run the following command in Windows PowerShell: \n\n```\nget-adobject -Identity 'cn=ATTRIBUTE,cn=Schema,cn=Configuration,dc=ROOT_DOMAIN,dc=TOP_LEVEL_DOMAIN' -Properties *\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eATTRIBUTE\u003c/var\u003e: The name of an attribute in your schema. For example, `example-attribute`.\n- \u003cvar translate=\"no\"\u003eROOT_DOMAIN\u003c/var\u003e: The root domain of your domain name. For example, if your domain name is `example.com`, enter `example`.\n- \u003cvar translate=\"no\"\u003eTOP_LEVEL_DOMAIN\u003c/var\u003e: The top-level domain of your domain name. For example, if your domain name is `example.com`, enter `com`.\n\nIn the response, verify if you can see the changes in classes and attributes of the schema.\n\nWhat's next\n-----------\n\n- [Back up and restore a domain](/managed-microsoft-ad/docs/backup-restore)"]]