Skip to content

Instantly share code, notes, and snippets.

@triti
Created June 14, 2013 20:31
Show Gist options
  • Select an option

  • Save triti/5785033 to your computer and use it in GitHub Desktop.

Select an option

Save triti/5785033 to your computer and use it in GitHub Desktop.

Revisions

  1. triti revised this gist Jun 14, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions fix-snowleopard-upn-ad.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/bin/bash
    # https://gist.github.com/fizzboy/5785033

    ADPLIST=/Library/Preferences/DirectoryService/ActiveDirectory.plist
    PLISTBUDDY=/usr/libexec/PlistBuddy
  2. triti revised this gist Jun 14, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion fix-snowleopard-upn-ad.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,12 @@
    #!/bin/bash

    ADPLIST=/Library/Preferences/DirectoryService/ActiveDirectory.plist
    PLISTBUDDY=/usr/libexec/PlistBuddy

    # Backup the Active Directory plist
    /bin/cp "$ADPLIST" "$ADPLIST~bak"

    # Modify the needed attributes to no longer require the userProfileName
    # Modify the needed attributes to no longer require the userPrincipalName
    "$PLISTBUDDY" -c 'Delete :"AD LDAP Attribs Needed Table":dsAttrTypeNative\:kerberosPrincipal' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeNative\:kerberosPrincipal array' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeNative\:kerberosPrincipal:0 string sAMAccountName' "$ADPLIST"
  3. triti created this gist Jun 14, 2013.
    30 changes: 30 additions & 0 deletions fix-snowleopard-upn-ad.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    ADPLIST=/Library/Preferences/DirectoryService/ActiveDirectory.plist
    PLISTBUDDY=/usr/libexec/PlistBuddy

    # Backup the Active Directory plist
    /bin/cp "$ADPLIST" "$ADPLIST~bak"

    # Modify the needed attributes to no longer require the userProfileName
    "$PLISTBUDDY" -c 'Delete :"AD LDAP Attribs Needed Table":dsAttrTypeNative\:kerberosPrincipal' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeNative\:kerberosPrincipal array' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeNative\:kerberosPrincipal:0 string sAMAccountName' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeNative\:kerberosPrincipal:1 string cn' "$ADPLIST"

    "$PLISTBUDDY" -c 'Delete :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AltSecurityIdentities' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AltSecurityIdentities array' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AltSecurityIdentities:0 string altSecurityIdentities' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AltSecurityIdentities:1 string samAccountName' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AltSecurityIdentities:2 string cn' "$ADPLIST"

    "$PLISTBUDDY" -c 'Delete :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AuthenticationAuthority' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AuthenticationAuthority array' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AuthenticationAuthority:0 string sAMAccountName' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:AuthenticationAuthority:1 string objectGUID' "$ADPLIST"

    "$PLISTBUDDY" -c 'Delete :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:RecordName' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:RecordName array' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:RecordName:0 string displayName' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:RecordName:1 string samAccountName' "$ADPLIST"
    "$PLISTBUDDY" -c 'Add :"AD LDAP Attribs Needed Table":dsAttrTypeStandard\:RecordName:2 string cn' "$ADPLIST"

    /usr/bin/killall -KILL DirectoryService