PowerShell Logo Small

New-ADOrganizationalUnit



This is the built-in help made by Microsoft for the command 'New-ADOrganizationalUnit', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates a new Active Directory organizational unit.

SYNTAX


New-ADOrganizationalUnit [-Name] <String> [-AuthType {Negotiate | Basic}] [-City <String>] [-Country <String>] [-Credential <PSCredential>] [-Description <String>]
[-DisplayName <String>] [-Instance <ADOrganizationalUnit>] [-ManagedBy <ADPrincipal>] [-OtherAttributes <Hashtable>] [-PassThru] [-Path <String>] [-PostalCode <String>]
[-ProtectedFromAccidentalDeletion <Boolean>] [-Server <String>] [-State <String>] [-StreetAddress <String>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The New-ADOrganizationalUnit cmdlet creates a new Active Directory organizational unit. You can set commonly used organizational unit property values by using the cmdlet
parameters. Property values that are not associated with cmdlet parameters can be set by using the OtherAttributes parameter.


You must set the Name parameter to create a new organizational unit. When you do not specify the Path parameter, the cmdlet creates an organizational unit under the default
NC head for the domain.


The following methods explain different ways to create an object by using this cmdlet.


Method 1: Use the New-ADOrganizationalUnit cmdlet, specify the required parameters, and set any additional property values by using the cmdlet parameters.


Method 2: Use a template to create the new object. To do this, create a new organizational unit object or retrieve a copy of an existing organizational unit object and set
the Instance parameter to this object. The object provided to the Instance parameter is used as a template for the new object. You can override property values from the
template by setting cmdlet parameters. For more information, see the Instance parameter description for this cmdlet.


Method 3: Use the Import-Csv cmdlet with the New-ADOrganizationalUnit cmdlet to create multiple Active Directory organizational unit objects. To do this, use the Import-Csv
cmdlet to create the custom objects from a comma-separated value (CSV) file that contains a list of object properties. Then pass these objects through the pipeline to the
New-ADOrganizationalUnit cmdlet to create the organizational unit objects.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=291069
Get-ADOrganizationalUnit
Remove-ADOrganizationalUnit
Set-ADOrganizationalUnit

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>New-ADOrganizationalUnit -Name "UserAccounts" -Path "DC=FABRIKAM,DC=COM"



This command creates a new OrganizationalUnit named UserAccounts which is protected from accidental deletion.




-------------------------- EXAMPLE 2 --------------------------

PS C:\>New-ADOrganizationalUnit -Name "UserAccounts" -Path "DC=FABRIKAM,DC=COM" -ProtectedFromAccidentalDeletion $False



This command creates a new OrganizationalUnit named 'UserAccounts' which is not protected from deletion.




-------------------------- EXAMPLE 3 --------------------------

PS C:\>New-ADOrganizationalUnit -Name "UserAccounts" -Path "DC=FABRIKAM,DC=COM" -OtherAttributes
@{seeAlso="CN=HumanResourceManagers,OU=Groups,OU=Managed,DC=Fabrikam,DC=com";managedBy="CN=TomC,DC=FABRIKAM,DC=COM"}



This command creates an OrganizationalUnit named UserAccounts which is protected from accidental deletion with properties seeAlso and managedBy set to the specified values.




-------------------------- EXAMPLE 4 --------------------------

PS C:\>$ouTemplate = Get-ADOrganizationalUnit -Identity "OU=UserAccounts,DC=Fabrikam,DC=com" -Properties seeAlso,managedBy
PS C:\> New-ADOrganizationalUnit -Name "TomCReports" -Instance $ouTemplate



This command uses the data from the OrganizationalUnit OU=UserAccounts,DC=Fabrikam,DC=com as a template for another new OrganizationalUnit.




-------------------------- EXAMPLE 5 --------------------------

PS C:\>New-ADOrganizationalUnit -Name "Managed" -Path "DC=AppNC" -Server "FABRIKAM-SRV1:60000"



This command creates a new OrganizationalUnit named Managed in an LDS instance.