Part of samba View In Hierarchy
Known subclasses: samba.idmap.IDmapDB, samba.samdb.SamDB
Please note that this is intended to be for all Samba LDB files, not necessarily the Sam database. For Sam-specific helper functions see samdb.py.
| Method | __init__ | Opens a Samba Ldb file. |
| Method | searchone | Search for one attribute as a string. |
| Method | erase_users_computers | Erases user and computer objects from our AD. |
| Method | erase_except_schema_controlled | Erase this ldb. |
| Method | erase | Erase this ldb, removing all records. |
| Method | load_ldif_file_add | Load a LDIF file. |
| Method | add_ldif | Add data based on a LDIF string. |
| Method | modify_ldif | Modify database based on a LDIF string. |
This is different from a regular Ldb file in that the Samba-specific modules-dir is used by default and that credentials and session_info can be passed through (required by some modules).
| Parameters | url | Optional LDB URL to open |
| lp | Optional loadparm object | |
| modules_dir | Optional modules directory | |
| session_info | Optional session information | |
| credentials | Optional credentials, defaults to anonymous. | |
| flags | Optional LDB flags | |
| options | Additional options (optional) |
| Parameters | basedn | BaseDN for the search. |
| attribute | Name of the attribute | |
| expression | Optional search expression. | |
| scope | Search scope (defaults to base). | |
| Returns | Value of attribute as a string or None if it wasn't found. | |
This is needed since the 'samldb' module denies the deletion of primary groups. Therefore all groups shouldn't be primary somewhere anymore.