Расширение схемы AD - невозможно обновить из-за ограничений - PullRequest
0 голосов
/ 13 января 2012

Я добавляю некоторые атрибуты из live в staging для тестирования, я использую ldifde:

D:\Shared>ldifde -i -v -f attr3.ldf -j .
Connecting to "myDomain.com"
Logging in as current user using SSPI
Importing directory from file "attr3.ldf"
Loading entries
1: CN=myAttribute,CN=Schema,CN=Configuration,DC=myDomain,DC=com
Entry modified successfully.


1 entry modified successfully.

The command has completed successfully

D:\Shared>

Но когда я пытаюсь обновить его с помощью vbs, я получаю:

C:\Users\update.vbs(8, 1) Active Directory: The requested operation did not 
satisfy one or more constraints associated with the class of the object.

Обратите внимание, что другие атрибуты, оригинальные, могут быть обновлены, эта проблема только для тех, которые я импортирую.

Итак, мне интересно, если я пропускаю какой-то шаг, напримерсвязать или отсоединить новый атрибут после импорта.

Это attr3.ldf

#attr3.ldf
#adding my new attribute
dn: CN=myAttribute,CN=Schema,CN=Configuration,DC=myDomain,DC=com
changetype: add
objectClass: top
objectClass: attributeSchema
cn: my-Attribute
distinguishedName: CN=my-Attribute,CN=Schema,CN=Configuration,DC=myDomain,DC=com
instanceType: 4
whenCreated: 20100401175340.0Z
whenChanged: 20100401175341.0Z
uSNCreated: 24154
attributeID: 2.16.840.1.113805.111
attributeSyntax: 2.5.5.12
isSingleValued: TRUE
rangeLower: 0
rangeUpper: 1
uSNChanged: 24163
showInAdvancedViewOnly: TRUE
adminDisplayName: my-Attribute
adminDescription: my-Attribute
oMSyntax: 64
searchFlags: 0
lDAPDisplayName: myAttribute
name: my-Attribute
schemaIDGUID:: tonVW6suWUu1Gev/D1pI9Q==
isMemberOfPartialAttributeSet: TRUE
objectCategory: CN=Attribute-Schema,CN=Schema,CN=Configuration,DC=myDomain,DC=com

#The following attributes were removed because I was getting:
#Add error on entry starting on line 1: Unwilling To Perform
#The server side error is: 0x20e7 The modification was not permitted for security
#reasons.
#The extended server error is:
#000020E7: SvcErr: DSID-03152D2C, problem 5003 (WILL_NOT_PERFORM), data 0

#objectGUID:: eTKYtnXbCE2fPMgc8UIe0w==
#attributeSecurityGUID:: VAGN5Pi80RGHAgDAT7lgUA==

А это код vbs,

'update.vbs
Set objUser = GetObject("LDAP://CN=John Lennon,CN=Users,DC=myDomain,DC=com") 
objUser.myAttribute="someValue"  'Also tried with integers but not luck
objUser.SetInfo

Спасибо, m0dest0.


Спасибо, JPBlanc, вы правы, мне не хватало добавить attr в класс и затем обновить схему,

  1. Зарегистрировать dll, regsvr32 schmmgmt.dll
  2. Откройте Run и введите mmc.exe
  3. Добавить оснастку схемы Active Directory
  4. Щелкните правой кнопкой мыши класс, свойства, нажмите кнопку Добавить и т. Д.
  5. Наконец, обновите схему:

    C: \ Users> admod -sc refreshschema

    AdMod V01.17.00cpp Джо Ричардс (joe@joeware.net)Март 2011

    Изменение ROOTDSE ... Количество DN: 1 Использование сервера: myServer.myDomain.com:389 Каталог: Windows Server 2008 R2

    Изменение указанных объектов ... DN: ROOTDSE ...

    Команда успешно выполнена

С уважением,

1 Ответ

1 голос
/ 14 января 2012

Добавление атрибута в схему не достаточно, вы также должны добавить атрибут в пользовательский класс (в schma), если вы хотите использовать его в пользовательском объекте. Вы должны изменить свой файл LDIF:

# Define your attribute

# Reload the schema
dn:
changetype: modify
add: schemaUpdateNow
schemaUpdateNow: 1
-
# modify user class

Посмотрите на свою схему с помощью Microsoft MMC (регистрация schmmgmt.dll)

Если у вас все еще есть проблемы, я могу помочь завтра утром.

...