Skip to content

Instantly share code, notes, and snippets.

@Nora-Ballard
Created February 20, 2014 22:42
Show Gist options
  • Select an option

  • Save Nora-Ballard/9124822 to your computer and use it in GitHub Desktop.

Select an option

Save Nora-Ballard/9124822 to your computer and use it in GitHub Desktop.
LDIF for adding sAMAccountName attribute to the directory. Useful for adding this attribute to ADAM/ADLDS schema for use with 'userProxy' objects.
# ==================================================================
#
# This file should be imported with the following command:
# ldifde -i -u -f test3.ldf -s server:port -b username domain password -j . -c "cn=Configuration,dc=X" #configurationNamingContext
# LDIFDE.EXE from AD/AM V1.0 or above must be used.
# This LDIF file should be imported into AD or AD/AM. It may not work for other directories.
#
# ==================================================================
# ==================================================================
# Attributes
# ==================================================================
# Attribute: sAMAccountName
dn: cn=SAM-Account-Name,cn=Schema,cn=Configuration,dc=X
changetype: add
objectClass: attributeSchema
attributeId: 1.2.840.113556.1.4.221
ldapDisplayName: sAMAccountName
attributeSyntax: 2.5.5.12
adminDescription: SAM-Account-Name
adminDisplayName: SAM-Account-Name
# schemaIDGUID: 3e0abfd0-126a-11d0-a060-00aa006c33ed
schemaIDGUID:: 0L8KPmoS0BGgYACqAGwz7Q==
# attributeSecurityGUID: General Information
attributeSecurityGUID:: Qi+6WaJ50BGQIADAT8LTzw==
oMSyntax: 64
searchFlags: 13
systemFlags: 18
isMemberOfPartialAttributeSet: TRUE
isSingleValued: TRUE
systemOnly: FALSE
rangeLower: 0
rangeUpper: 256
dn:
changetype: modify
add: schemaUpdateNow
schemaUpdateNow: 1
-
# ==================================================================
# Updating present elements
# ==================================================================
# Update element: securityPrincipal
dn: cn=Security-Principal,cn=Schema,cn=Configuration,dc=X
changetype: modify
add: mayContain
# mayContain: sAMAccountName
mayContain: 1.2.840.113556.1.4.221
-
dn:
changetype: modify
add: schemaUpdateNow
schemaUpdateNow: 1
-
@instw
Copy link

instw commented Jan 29, 2016

When I tried to run ldifde, I got an error: "Failed on line 1. The last token starts with '‣'." . If you get the error, change the encoding type of the file to be "Unicode" and re-run ldifde.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment