Novell Home

My Favorites

Close

Please to see your favorites.

DSfW: How to find duplicate objectsids

This document (7011617) is provided subject to the disclaimer at the end of this document.

Environment

Novell Open Enterprise Server 11 SP2 (OES11SP2)
Novell Open Enterprise Server 11 SP1 (OES11SP1)
Domain Serices for Windows
DSFW

Situation

How to find and remove duplicate sids

Resolution

DEFAULTNAMINGCONTEXT=`/usr/bin/ldapsearch -x -b "" -s base defaultnamingcontext | grep -i 'defaultnamingcontext: ' | awk '{print $2}'`

export LDAPCONF=/etc/opt/novell/xad/openldap/ldap.conf

ldapsearch -Y EXTERNAL -LLL -Q -b "$DEFAULTNAMINGCONTEXT" -s sub "(&(objectclass=*)(objectsid=*))" cn objectsid >/tmp/objectsids.log

sids=$(grep -i objectsid:: /tmp/objectsids.log|sort |uniq -c |sort -n |grep -v ' 1 ' |awk '{print $3}')
sids2=$(echo $sids | sed -e 's/ /\\|/g')

grep -e $sids2 -B 2 /tmp/objectsids.log  >/tmp/duplicateObjectsids.log

Look at the /tmp/duplicateObjectsids.log for objects with duplicate sids

Additional Information

#!/bin/bash

defaultnamingcontext=`/usr/bin/ldapsearch -x -b "" -s base defaultnamingcontext | grep -i 'defaultnamingcontext: ' | awk '{print $2}'`

export LDAPCONF=/etc/opt/novell/xad/openldap/ldap.conf

ldapsearch -Y EXTERNAL -LLL -Q -b "$defaultnamingcontext" -s sub "(&(objectclass=*)(objectsid=*))" cn objectsid >/tmp/objectsids.log

sids=$(grep -i objectsid:: /tmp/objectsids.log|sort |uniq -c |sort -n |grep -v ' 1 ' |awk '{print $3}')
sids2=$(echo $sids | sed -e 's/ /\\|/g')

grep -e $sids2 -B 2 /tmp/objectsids.log  >/tmp/duplicateObjectsids.log

less /tmp/duplicateObjectsids.log

Disclaimer

This Support Knowledgebase provides a valuable tool for NetIQ/Novell/SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7011617
  • Creation Date:13-JAN-13
  • Modified Date:06-JAN-14
    • NovellOpen Enterprise Server
    • SUSESUSE Linux Enterprise Server
    • NetIQeDirectory

Did this document solve your problem? Provide Feedback