Page 1 of 1
List PDLs that a user is a member of
Posted: Fri Jun 03, 2005 5:46 pm
by ink
I can use omshowpdln to list the users that belong to a PDL and I can use omshowpdl to list PDLs in the directory. Is there a way to list the PDLs that a user is a member of? Something like
omshowpdln -l -n '/mail,com/CN=Test User'
And it would come back with some sort of list:
ScalixAdmins /mail,com/CN=ScalixAdmins
ldapadmin /internet/CN=ldapadmin
email /internet/CN=email
Posted: Sun Jun 05, 2005 5:10 am
by florian
Ink,
while there is no such command, this is a great example to illustrate the power of Unix scripting combined with the structure of the Scalix command line tools. Save the following lines as a script and try to run it as ./script.sh "Mike Myers" - hope it does what you need!
Code: Select all
#!/bin/bash
if [ $# -ne 1 -o -z "$1" ]; then
echo "Usage: $0 <username>" >&2
exit 1
fi
USER=`omsearch -x -e "$1" | omfmtent -X`
DLs=`omsearch -e "$USER" -m PARENT-DL | sed -e 's/PARENT-DL=//' -e 's/=/ /'`
set $DLs
while [ $# -gt 0 ]
do
omsearch -e "LOCAL-UNIQUE-ID=$1" | omfmtent -x
shift
done
No guarantees for bugs though, this was Sunday morning scripting... :-)
Florian.
Posted: Tue Jun 07, 2005 12:38 pm
by ink
Nice, I think that's better than my script that walked all mailing lists with grep. :-)
Posted: Tue Jun 07, 2005 3:07 pm
by florian
Well, I know at least one person within Scalix who would change that to be multi-instance ready and cleaned up for perfection, but it's as good as it gets on a Sunday morning! :-)
-- F.
Posted: Tue Jun 13, 2006 9:24 pm
by abnormaliti
Small correction
Code: Select all
#!/bin/bash
if [ $# -ne 1 -o -z "$1" ]; then
echo "Usage: $0 <username>" >&2
exit 1
fi
USER=`omsearch -x -e "$1" | omfmtent -X`
DLs=`omsearch -e "$USER" -m PARENT-DL | sed -e 's/PARENT-DL=//' -e 's/=/ /g'`
set $DLs
while [ $# -gt 0 ]
do
omsearch -e "LOCAL-UNIQUE-ID=$1" | omfmtent -x
shift
done