PowerShell Logo Small

New-ADOrganizationalUnit



This is the built-in help made by Microsoft for the command 'New-ADOrganizationalUnit', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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 <ADAuthType>] [-City <String>] [-Country <String>] [-Credential <PSCredential>]
[-Description <String>] [-DisplayName <String>] [-Instance <ADOrganizationalUnit>] [-ManagedBy <ADPrincipal>] [-OtherAttributes <Hashtable>]
[-PassThru [<SwitchParameter>]] [-Path <String>] [-PostalCode <String>] [-ProtectedFromAccidentalDeletion <Boolean>] [-Server <String>]
[-State <String>] [-StreetAddress <String>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<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 examples and 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/?LinkID=219328
Get-ADOrganizationalUnit
Remove-ADOrganizationalUnit
Set-ADOrganizationalUnit

REMARKS

<

Examples


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

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



Description

-----------

Creates a new OrganizationalUnit named 'UserAccounts' which is protected from accidental deletion.




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

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



Description

-----------

Creates a new OrganizationalUnit named 'UserAccounts' which is not protected from deletion.




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

C:\PS>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"}



Description

-----------

Creates an OrganizationalUnit name 'UserAccounts' which is protected from accidental deletion with properties 'seeAlso' and 'managedBy' set to
the specified values.




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

C:\PS>$ouTemplate = Get-ADOrganizationalUnit "OU=UserAccounts,DC=Fabrikam,DC=com" -properties seeAlso,managedBy; New-ADOrganizationalUnit
-name TomCReports -instance $ouTemplate



Description

-----------

Uses the data from the OrganizationalUnit 'OU=UserAccounts,DC=Fabrikam,DC=com' as a template for another new OrganizationalUnit.




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

C:\PS>New-ADOrganizationalUnit -name "Managed" -path "DC=AppNC" -server "FABRIKAM-SRV1:60000"



Description

-----------

Creates a new OrganizationalUnit named 'Managed' in an LDS instance.