Hello: I'd really like to leverage the samba-python API to perform 'net ads search' style queries for an upcoming project. Is there any documentation or examples someone can point me to? The 'python/examples' directory is a misnomer (!) and the online API documentation was generated from 2011 and is also just as cryptic. I even checked the binaries in samba-client to see if any existing utilities are using these Python libraries but alas, they are show up as ELFs! :-( Any pointers or insights into leveraging these module will be much appreciated! -aps
mathias dufresne
2015-Nov-04 16:09 UTC
[Samba] Using samba-python to query AD? Status of API?
Hi, Once you have installed Samba to be able to run it as Active Directory you would have samba-tool available. # which samba-tool /usr/bin/samba-tool # file /usr/bin/samba-tool /usr/bin/samba-tool: Python script, ASCII text executable # locate ldapcmp.py /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.py /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.pyc /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.pyo # file /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.py /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.py: Python script, ASCII text executable I gave the commands because they help to find where are really these files. They could be in some other directory on your system. There are a lot of other (python) files in there. Hoping this helps. Kindly regards, mathias 2015-11-04 16:58 GMT+01:00 pisymbol . <pisymbol at gmail.com>:> Hello: > > I'd really like to leverage the samba-python API to perform 'net ads > search' style queries for an upcoming project. > > Is there any documentation or examples someone can point me to? The > 'python/examples' directory is a misnomer (!) and the online API > documentation was generated from 2011 and is also just as cryptic. > > I even checked the binaries in samba-client to see if any existing > utilities are using these Python libraries but alas, they are show up > as ELFs! :-( > > Any pointers or insights into leveraging these module will be much > appreciated! > > -aps > > -- > To unsubscribe from this list go to the following URL and read the > instructions: https://lists.samba.org/mailman/options/samba >
On Wed, Nov 4, 2015 at 11:09 AM, mathias dufresne <infractory at gmail.com> wrote:> Hi, > > Once you have installed Samba to be able to run it as Active Directory you > would have samba-tool available. > > # which samba-tool > /usr/bin/samba-tool > # file /usr/bin/samba-tool > /usr/bin/samba-tool: Python script, ASCII text executable > # locate ldapcmp.py > /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.py > /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.pyc > /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.pyo > # file /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.py > /usr/lib64/python2.7/site-packages/samba/netcmd/ldapcmp.py: Python script, > ASCII text executable > > I gave the commands because they help to find where are really these files. > They could be in some other directory on your system. > There are a lot of other (python) files in there.Hmph. This command doesn't look like its shipped in the standard samba4 CentOS RPMS. Bummer. Alright, I will grab it from the source tree and take a look! Thanks! -aps