COMMAND EVERYTHING.
Creates an Active Directory organizational unit.
Microsoft ActiveDirectory reference: Creates an Active Directory organizational unit. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for New-ADOrganizationalUnit. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Windows / ActiveDirectory · Windows Server 2025 documentation; feature/module prerequisites apply
-AuthType- Specifies the authentication method to use. The acceptable values for this parameter are: - Negotiate or 0 - Basic or 1 The default authentication method is Negotiate. A Secure Sockets Layer (SSL) connection is required for the Basic authentication method.
-City- Specifies the town or city. This parameter sets the City property of an OU object. The Lightweight Directory Access Protocol (LDAP) display name (ldapDisplayName) of this property is l.
-Confirm- Prompts you for confirmation before running the cmdlet.
-Country- Specifies the country or region code. This parameter sets the Country property of an OU object. The LDAP display name (ldapDisplayName) of this property is c. This value is not used by Windows 2000.
-Credential- Specifies the user account credentials to use to perform this task. The default credentials are the credentials of the currently logged on user unless the cmdlet is run from an Active Directory PowerShell provider drive. If the cmdlet is run from such a provider drive, the account associated with the drive is the default. To specify this parameter, you can type a user name, such as User1 or Domain01\User01 or you can specify a PSCredential object. If you specify a user name for this parameter, the cmdlet prompts for a password. You can also create a PSCredential object by using a script or by using the Get-Credential cmdlet. You can then set the *Credential* parameter to the PSCredential object. If the acting credentials do not have directory-level permission to perform the task, Active Directory PowerShell returns a terminating error.
-Description- Specifies a description of the object. This parameter sets the value of the Description property for the OU object. The LDAP display name (ldapDisplayName) for this property is description.
-DisplayName- Specifies the display name of the object. This parameter sets the DisplayName property of the OU object. The LDAP display name (ldapDisplayName) for this property is displayName.
-Instance- Specifies an instance of an OU object to use as a template for a new OU object. You can use an instance of an existing OU object as a template or you can construct a new OU object by using the Windows PowerShell command line or by using a script. Method 1: Use an existing OU object as a template for a new object. To retrieve an instance of an existing OU object use Get-ADOrganizationalUnit. Then provide this object to the *Instance* parameter of the New-ADOrganizationalUnit cmdlet to create a new OU object. You can override property values of the new object by setting the appropriate parameters. Method 2: Create a new ADOrganizationalUnit object and set the property values by using the Windows PowerShell command line interface. Then pass this object to the *Instance* parameter of the New-ADOrganizationalUnit cmdlet to create the new Active Directory OU object. > [!NOTE] > Specified attributes are not validated, so attempting to set attributes that do not exist or cannot be set raises an error.
-ManagedBy- Specifies the user or group that manages the object by providing one of the following property values. Note: The identifier in parentheses is the LDAP display name for the property. The acceptable values for this parameter are: - A distinguished name - A GUID (objectGUID) - A security identifier (objectSid) - A SAM account name (sAMAccountName) This parameter sets the Active Directory attribute with an LDAP display name of managedBy.
-Name (required)- Specifies the name of the object. This parameter sets the Name property of the OU object. The LDAP display name (ldapDisplayName) of this property is name.
-OtherAttributes- Specifies object attribute values for attributes that are not represented by cmdlet parameters. You can set one or more parameters at the same time with this parameter. If an attribute takes more than one value, you can assign multiple values. To identify an attribute, specify the LDAP display name (ldapDisplayName) defined for it in the Active Directory schema. To specify a single value for an attribute: -OtherAttributes @{'AttributeLDAPDisplayName'=value} To specify multiple values for an attribute, separate the values with a comma: -OtherAttributes @{'AttributeLDAPDisplayName'=value1,value2,...} To specify values for multiple attributes, separate the attributes with a semi-colon: -OtherAttributes @{'Attribute1LDAPDisplayName'=value; 'Attribute2LDAPDisplayName'=value1,value2;...}
-PassThru- Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
-Path- Specifies the X.500 path of the OU or container where the new object is created. In many cases, a default value is used for the *Path* parameter if no value is specified. The rules for determining the default value are given below. Note that rules listed first are evaluated first and when a default value can be determined, no further rules are evaluated. In Active Directory Domain Services (AD DS) environments, a default value for *Path* is set in the following cases: - If the cmdlet is run from an Active Directory PowerShell provider drive, the parameter is set to the current path of the provider drive. - If the cmdlet has a default path, this is used. For example: in New-ADUser, the *Path* parameter defaults to the Users container. - If none of the previous cases apply, the default value of *Path* is set to the default partition or naming context of the target domain. In AD LDS environments, a default value for *Path* is set in the following cases: - If the cmdlet is run from an Active Directory module for PowerShell provider drive, the parameter is set to the current path of the provider drive. - If the cmdlet has a default path, this is used. For example: in New-ADUser, the *Path* parameter defaults to the Users container. - If the target AD LDS instance has a default naming context, the default value of *Path* is set to the default naming context. To specify a default naming context for an AD LDS environment, set the msDS-defaultNamingContext property of the Active Directory directory service agent object (nTDSDSA) for the AD LDS instance. - If none of the previous cases apply, the *Path* parameter does not take any default value. > [!NOTE] > The Active Directory Provider cmdlets, such as New-Item, Remove-Item, Remove-ItemProperty, Rename-Item, and Set-ItemProperty, also contain a Path property. > > However, for the Active Directory Provider cmdlets, the *Path* p
-PostalCode- Specifies the postal code or zip code. This parameter sets the PostalCode property of an OU object. The LDAP display name (ldapDisplayName) of this property is postalCode.
-ProtectedFromAccidentalDeletion- Indicates whether to prevent the object from being deleted. When this property is set to $True, you cannot delete the corresponding object without changing the value of the property. The acceptable values for this parameter are: - $False or 0 - $True or 1
-Server- Specifies the AD DS instance to connect to, by providing one of the following values for a corresponding domain name or directory server. The service may be any of the following: AD LDS, AD DS, or Active Directory snapshot instance. Specify the AD DS instance in one of the following ways: Domain name values: - Fully qualified domain name - NetBIOS name Directory server values: - Fully qualified directory server name - NetBIOS name - Fully qualified directory server name and port The default value for this parameter is determined by one of the following methods in the order that they are listed: - By using the *Server* value from objects passed through the pipeline - By using the server information associated with the AD DS Windows PowerShell provider drive, when the cmdlet runs in that drive - By using the domain of the computer running Windows PowerShell
-State- Specifies a state or province. This parameter sets the State property of an OU object. The LDAP display name (ldapDisplayName) of this property is st.
-StreetAddress- Specifies a street address. This parameter sets the StreetAddress property of an OU object. The LDAP display name (ldapDisplayName) of this property is street.
-WhatIf- Shows what would happen if the cmdlet runs. The cmdlet is not run.
Windows with the ActiveDirectory module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.