Wednesday, March 3, 2010

How to get opends record count

Following command will give you the exact record count under the given dn: {ou=subscribers,dc=mycompany,dc=com}
Script is using the virtual attribute called {numsubordinates}

sh /space/opends/OpenDS-2.2.0/bin/ldapsearch -h localhost -p 389 -D cn='Directory Manager' -w mycpassword -b "ou=subscribers,dc=mycompany,dc=com" -s base "objectclass=*" numsubordinates| grep "numsubordinates:"| cut -c "18-" > /space/.subscriberCount

Note: Output will be saved under /space/.subscriberCount file.Please customize it for yourself

No comments:

Post a Comment