У меня проблемы с созданием новых ADOrganizationalUnits и ADGroups. Это нужно сделать в Powershell, но я просто не понимаю концепцию по какой-то причине. Вот мой код:
Я просмотрел документацию, но все еще не могу понять.
# Script to create New AD Org. Units
#Author : Phil Bauer
Import-Module ActiveDirectory
$oupath = "OU=Business,DC=PhilB,DC=local"
$oupathIT = "OU=IT,OU=Business,DC=PhilB,DC=local"
$oupathSales = "OU=Sales,OU=Business,DC=PhilB,DC=local"
$oupathDesign = "OU=Design,OU=Business,DC=PhilB,DC=local"
$oupathMark = "OU=Marketing,OU=Business,DC=PhilB,DC=local"
$oupathProd = "OU=Production,OU=Business,DC=PhilB,DC=local"
New-ADGroup -Name: "HelpDesk" -DisplayName: "Help Desk" -path: "OU=Business , DC=PhilB , DC=local"
New-ADOrganizationalUnit -Name: "Sales" -path: $oupath
New-ADOrganizationalUnit -Name: "Design" -path: $oupath
New-ADOrganizationalUnit -Name: "Marketing" -path: $oupath
New-ADOrganizationalUnit -Name: "Production" -path: $oupath
New-ADOrganizationalUnit -Name: "IT" -path: $oupath
New-ADGroup -Name: "SalesIT" -DisplayName: "Sales IT" -GroupCategory: "Security" -GroupScope: "Global" -path: $oupathIT -
New-ADGroup -Name: "DisplayIT" -DisplayName: "Design IT" -GroupCategory: "Security" -GroupScope: "Global" -path: $oupathIT
New-ADGroup -Name: "MkgtIT" -DisplayName: "Marketing IT" -GroupCategory: "Security" -GroupScope: "Global" -path: $oupathIT
New-ADGroup -Name: "DsgnIT" -DisplayName: "Production IT" -GroupCategory: "Security" -GroupScope: "Global" -path: $oupathIT
New-ADGroup -Name: "SalesMgr" -DisplayName: "Sales Manager" -GroupCategory: "Security" -GroupScope: "Global" -path: $oupathSales
New-ADGroup -Name: "SalesField"-DisplayName: "Field Sales" -GroupCategory: "Security" -GroupScope: "Global" -path: $oupathSales
New-ADGroup -Name: "DsgnMgr" -DisplayName: "Design Manager " -GroupCategory: "Security" -GroupScope: "Global" -path: $oupathDesign
New-ADGroup -Name: "Dsgn" -DisplayName: "Designers" -GroupCategory: "Security" -GroupScope: "Global" -path $oupathDesign
New-ADGroup -Name:"MktHead" -DisplayName: "Lead Marketer" -GroupCategory: "Security" -GroupScope: "Global" -path $oupathMark
New-ADGroup -Name: "MktJr" -DisplayName: "Marketing Juniors" -GroupCategory: "Security" -GroupScope: "Global" -path $oupathMark
New-ADGroup -Name: "ProdMgr" -DisplayName: "Production Manager" -GroupCategory: "Security" -GroupScope: "Global" -path $oupathProd
New-ADGroup -Name: "ProdTeam" -DisplayName: "Production Team" -GroupCategory: "Security" -GroupScope: "Global" -path $oupathProd
Сообщение об ошибке, которое я получаю, выглядит так:
New-ADOrganizationalUnit : The server is unwilling to process the request
At line:13 char:1
+ New-ADOrganizationalUnit -Name: "Sales" -path: $oupath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (OU=Sales,OU=Business,DC=PhilB,DC=local:String) [New-ADOrganizationalUnit]
, ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Management.Commands.NewADOrganizationa
lUnit