Active Directory / LDAP
v0.10.0Active Directory / LDAP MCP server: find users, groups, memberships; read-only security audits.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
test_connection Test Connection
Test connectivity and bind to the AD server without raising. Returns a status dict with `ok`, `target`, `auth` and `error`. Use this to verify the configuration and reachability before running other tools.
| Parameter | Type | Description |
|---|---|---|
domain |
whoami Whoami
Report the identity the connection is bound as. Uses the RFC 4532 "Who Am I?" extended operation: the directory server reports the identity it actually authenticated, working with Kerberos/ SASL-GSSAPI as well as simple user/password bind. Returns `{"authzid": ...}`.
| Parameter | Type | Description |
|---|---|---|
domain |
get_rootdse_info Get Rootdse Info
Read the rootDSE of the domain controller answering this connection. Reports which DC you are talking to (`dnsHostName`, `serverName`), the naming contexts, the domain/forest/DC functional levels (with `*Functionality_name` companions), Global Catalog readiness and the supported controls/capabilities. The rootDSE is per-DC, not per-domain.
| Parameter | Type | Description |
|---|---|---|
domain |
health Health
Server health check: reports server name, mcpAD/msad version and AD connectivity.
| Parameter | Type | Description |
|---|---|---|
domain |
find_users Find Users
Find AD users by field. Criteria are ANDed; values may contain * wildcards. `city`/`state`/`country` match the `l`/`st`/`co` attributes. Pass `base` (a DN, e.g. an OU) to restrict the search to a subtree.
| Parameter | Type | Description |
|---|---|---|
base | ||
city | ||
country | ||
department | ||
domain | ||
limit | integer | |
mail | ||
name | ||
sam | ||
state | ||
surname |
get_user Get User
Get a single AD user by sAMAccountName, UPN, mail or cn (exact match).
| Parameter | Type | Description |
|---|---|---|
identifier * | string | |
domain |
find_groups Find Groups
Find AD groups by cn/name/sAMAccountName/displayName (supports * wildcards). Pass `base` (a DN, e.g. an OU) to restrict the search to a subtree.
| Parameter | Type | Description |
|---|---|---|
string * | string | |
base | ||
domain | ||
limit | integer |
get_group Get Group
Get a single AD group by sAMAccountName or cn (exact match).
| Parameter | Type | Description |
|---|---|---|
identifier * | string | |
domain |
get_by_dn Get By Dn
Fetch any AD entry directly by its distinguished name (DN). Use this to resolve DN-valued attributes into full records, e.g. the `manager` of a user or the `managedBy` owner of a group. Returns None if the DN does not exist.
| Parameter | Type | Description |
|---|---|---|
dn * | string | |
domain |
find_contacts Find Contacts
Find AD contact objects by cn/mail/displayName (supports * wildcards). Passing no `string` matches every contact. Pass `base` (a DN, e.g. an OU) to restrict the search to a subtree.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer | |
string |
find_computers Find Computers
Find AD computers by cn (name), dNSHostName (dns) or operatingSystem (os). Criteria are ANDed; values may contain * wildcards. Set `exclude_domain_controllers=True` to drop domain controllers from the results. Pass `base` (a DN, e.g. an OU) to restrict the search to a subtree.
| Parameter | Type | Description |
|---|---|---|
base | ||
dns | ||
domain | ||
exclude_domain_controllers | boolean | |
limit | integer | |
name | ||
os |
get_computer Get Computer
Get a single AD computer by sAMAccountName, cn or dNSHostName (exact match).
| Parameter | Type | Description |
|---|---|---|
identifier * | string | |
domain |
find_ous Find Ous
Find AD organizational units (OUs) by name (matches `ou`; may contain *). Pass `base` (a DN) to search under a specific parent OU instead of the whole domain.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer | |
name |
get_ou Get Ou
Get a single AD organizational unit by its `ou` name or full DN (exact).
| Parameter | Type | Description |
|---|---|---|
identifier * | string | |
domain |
find_empty_ous Find Empty Ous
Find organizational units with no nested sub-OU (hygiene/audit). Matches OUs whose `ou` attribute has no children. Pass `base` (a DN) to scope to a parent OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
get_ou_contents Get Ou Contents
List the objects contained under an OU (given its DN). Optionally restrict to a single `object_class` (e.g. user, group, computer, organizationalUnit). Returns an empty list if the OU DN does not exist.
| Parameter | Type | Description |
|---|---|---|
ou_dn * | string | |
domain | ||
limit | integer | |
object_class |
find_inactive_users Find Inactive Users
Find users whose last logon is older than `days` (default 90). Matches `lastLogonTimestamp` at or before the cutoff. Set `include_never=True` to also return users that never logged on. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
days | integer | |
domain | ||
include_never | boolean | |
limit | integer |
find_stale_computers Find Stale Computers
Find computers whose last logon is older than `days` (default 90). Matches `lastLogonTimestamp` at or before the cutoff. Set `include_never=True` to also return computers that never logged on. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
days | integer | |
domain | ||
include_never | boolean | |
limit | integer |
find_computers_by_os Find Computers By Os
Find computers whose `operatingSystem` matches `os` (* wildcards ok). Convenience over `find_computers` for OS-based inventory, e.g. `"Windows Server 2019*"`. Set `exclude_domain_controllers=True` to drop DCs. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
os * | string | |
base | ||
domain | ||
exclude_domain_controllers | boolean | |
limit | integer |
find_disabled_computers Find Disabled Computers
Find disabled computer accounts (ACCOUNTDISABLE UAC flag) (audit). The computer counterpart of `disabled_users`. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_obsolete_os_computers Find Obsolete Os Computers
Find computers running a commonly-cited end-of-life Windows version. ORs operatingSystem against a fixed list of legacy OS name prefixes (Windows 2000/XP/Vista/7/8, Server 2003/2008/2012) often used in AD security checklists. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
get_domain_info Get Domain Info
Read the domain object: security-relevant settings and metadata (audit).
| Parameter | Type | Description |
|---|---|---|
domain |
get_password_policy Get Password Policy
Read the default domain password policy (maxPwdAge, minPwdLength, ...).
| Parameter | Type | Description |
|---|---|---|
domain |
get_password_policy_violations Get Password Policy Violations
Find users whose password violates the domain policy (audit). Flags enabled users whose password has expired (older than the domain `maxPwdAge`) and, when `include_never_set` is True, users who must set a password at next logon (`pwdLastSet=0`). Accounts whose password never expires are excluded. Returns an empty list if the domain has no maximum password age.
| Parameter | Type | Description |
|---|---|---|
domain | ||
include_never_set | boolean | |
limit | integer |
get_privileged_groups Get Privileged Groups
Report on well-known privileged groups (Domain Admins, ...) with counts. Each entry includes the group's attributes plus `member_count`. Set `with_members=True` to include a `members` list (use `nested=True` to expand nested membership).
| Parameter | Type | Description |
|---|---|---|
domain | ||
nested | boolean | |
with_members | boolean |
group_members Group Members
List members of a group. Set nested=True for recursive membership.
| Parameter | Type | Description |
|---|---|---|
group * | string | |
domain | ||
limit | integer | |
nested | boolean |
user_groups User Groups
List the groups a user belongs to (nested/recursive by default).
| Parameter | Type | Description |
|---|---|---|
user * | string | |
domain | ||
limit | integer | |
nested | boolean |
is_member Is Member
Return True if the user is a (nested) member of the group.
| Parameter | Type | Description |
|---|---|---|
group * | string | |
user * | string | |
domain |
is_disabled Is Disabled
Return True if the account is disabled, None if the user is not found.
| Parameter | Type | Description |
|---|---|---|
user * | string | |
domain |
is_locked Is Locked
Return True if the account is locked, None if the user is not found.
| Parameter | Type | Description |
|---|---|---|
user * | string | |
domain |
disabled_users Disabled Users
List disabled user accounts (userAccountControl flag 2). Audit counterpart of `is_disabled`: returns every disabled account instead of checking a single user. Pass `base` (a DN) to scope to an OU, or `extra_filter` to AND an extra raw LDAP clause (must be pre-escaped).
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
extra_filter | string | |
limit | integer |
locked_users Locked Users
List locked-out user accounts (lockoutTime >= 1). Audit counterpart of `is_locked`: returns every locked account instead of checking a single user. Pass `base` (a DN) to scope to an OU, or `extra_filter` to AND an extra raw LDAP clause (must be pre-escaped).
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
extra_filter | string | |
limit | integer |
never_expires_password Never Expires Password
List users whose password never expires (userAccountControl flag 65536). A common security-audit check. Pass `base` (a DN) to scope to an OU, or `extra_filter` to AND an extra raw LDAP clause (must be pre-escaped).
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
extra_filter | string | |
limit | integer |
never_expiring_accounts Never Expiring Accounts
List users whose ACCOUNT (not password) never expires. Matches `accountExpires` set to the "never" sentinel values (0 or 9223372036854775807). Distinct from `never_expires_password`, which checks the password-never-expires UAC flag instead. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
expired_accounts Expired Accounts
List users whose `accountExpires` date is in the past (excluding "never"). Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
password_not_required Password Not Required
Risk: list users with the PASSWD_NOTREQD UAC flag (account may have no password). These accounts may have no password at all, letting anyone authenticate as them and set their own. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
kerberos_preauth_not_required Kerberos Preauth Not Required
Risk: list users not requiring Kerberos pre-authentication. These accounts are vulnerable to offline (AS-REP roasting) password guessing. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
not_delegated Not Delegated
Risk: list accounts flagged "sensitive and cannot be delegated". Worth auditing when a sensitive privilege was granted without also excluding the account from delegation (or vice versa). Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_service_accounts Find Service Accounts
Risk: list users with a Service Principal Name (SPN) set. Any account with an SPN can have a Kerberos service ticket requested for it by any authenticated user, then cracked offline ("Kerberoasting") if its password is weak. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_admin_count_accounts Find Admin Count Accounts
Find users with adminCount=1 (current or stale protected-admin marker). AD sets adminCount=1 via AdminSDHolder on members of protected groups (Domain Admins, Enterprise Admins, ...) and does not automatically clear it once the account is later removed from every such group. Accounts that still carry adminCount=1 but are no longer privileged keep a non-inherited, hardened ACL and are a common audit finding. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_must_change_password Find Must Change Password
Find enabled users who must change their password at next logon. Matches pwdLastSet=0, excluding disabled accounts. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_users_without_email Find Users Without Email
Data-quality check: list users with no `mail` attribute set. Accounts without an email address often can't receive password-expiry notices, MFA prompts or other automated notifications. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_almost_locked_out Find Almost Locked Out
Find enabled users close to the lockout threshold (badPwdCount). `badPwdCount` resets on a successful logon or once the domain's lockout observation window elapses, so this is a live, point-in-time signal (password-spraying in progress, or users about to be locked out). Compare `threshold` against the domain's actual `lockoutThreshold` (see `get_password_policy`). Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer | |
threshold | integer |
find_credentials_in_description Find Credentials In Description
Risk: list users whose description may contain a plaintext credential. A classic finding: admins sometimes note a password, PIN or hint directly in the `description` field, readable by any authenticated user by default. `keyword` defaults to ["pass", "pwd"] if omitted. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
keyword | ||
limit | integer |
find_shadow_credentials Find Shadow Credentials
Risk: list users/computers with a msDS-KeyCredentialLink (Shadow Credentials). A populated msDS-KeyCredentialLink registers an alternate certificate-based credential that can authenticate as the object without knowing its password -- a common persistence/privilege-escalation technique. Pass `object_class` ("user" or "computer") to restrict to one type, or omit to match either. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer | |
object_class |
find_unconstrained_delegation Find Unconstrained Delegation
Risk: users/computers trusted for unconstrained Kerberos delegation. Matches the TRUSTED_FOR_DELEGATION flag. Such an account receives (and can reuse) the TGT of every principal that authenticates to it. Domain controllers always have the flag and are excluded unless `include_domain_controllers` is true. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
include_domain_controllers | boolean | |
limit | integer |
find_constrained_delegation Find Constrained Delegation
Risk: accounts configured for constrained delegation (msDS-AllowedToDelegateTo). Returns the services each account may delegate to. The decoded userAccountControl shows whether protocol transition (TRUSTED_TO_AUTH_FOR_DELEGATION) is also enabled. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_rbcd Find Rbcd
Risk: objects with Resource-Based Constrained Delegation configured. Matches msDS-AllowedToActOnBehalfOfOtherIdentity (a binary security descriptor naming who may delegate to the object, returned raw). Unexpected RBCD entries are a known privilege-escalation path. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_computers_without_laps Find Computers Without Laps
Risk: enabled computers with no LAPS password expiration time. A computer managed by LAPS has ms-Mcs-AdmPwdExpirationTime (legacy) or msLAPS-PasswordExpirationTime (Windows LAPS); computers with neither are not covered. Only coverage is checked: passwords are never read. If the LAPS schema is not installed, every enabled computer matches. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
include_domain_controllers | boolean | |
limit | integer |
find_managed_service_accounts Find Managed Service Accounts
List managed service accounts: `kind` is "gmsa", "msa", or omitted for both. msDS-GroupMSAMembership (gMSA) lists who may retrieve the password. The managed password itself is never read. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
kind | ||
limit | integer |
find_sid_history Find Sid History
Risk: objects with a populated sIDHistory. Set by domain migrations; leftover values keep the old SIDs' access, and a privileged SID in it is a known persistence/escalation technique. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
password_changed_in_days Password Changed In Days
Return True if the user's password is older than `max_age` days. None if the user (or pwdLastSet) is not found.
| Parameter | Type | Description |
|---|---|---|
user * | string | |
domain | ||
max_age | integer |
get_dn Get Dn
Resolve a sAMAccountName (or DN) to a distinguished name (DN). Returns the value unchanged if it already looks like a DN, otherwise looks it up. Returns None if not found. Handy before `get_by_dn` or `get_ou_contents`.
| Parameter | Type | Description |
|---|---|---|
entry * | string | |
base | ||
domain |
audit_admin_accounts Audit Admin Accounts
Audit administrative accounts: members of well-known privileged groups. Builds on `get_privileged_groups` (Domain Admins, Enterprise Admins, Administrators, ...) and returns, per group that exists, its attributes, `member_count` and the expanded `members` list. Set `nested=False` to list only direct members instead of recursing into nested groups.
| Parameter | Type | Description |
|---|---|---|
domain | ||
nested | boolean |
list_fsmo_roles List Fsmo Roles
Report the owner of each of the five FSMO roles (audit). Returns one entry per role (`schema_master`, `domain_naming_master`, `pdc_emulator`, `rid_master`, `infrastructure_master`) with the `container` queried and the owning DSA DN (`owner`). The schema and domain-naming masters live in the Configuration naming context, derived from the domain base for a single-domain forest; pass `config_base` explicitly for a multi-domain forest. Containers the service account cannot read are skipped.
| Parameter | Type | Description |
|---|---|---|
config_base | ||
domain |
list_trusts List Trusts
List the domain's trust relationships (audit). Reads `trustedDomain` objects under `CN=System,<base>`: trust partner, direction, type and attributes. Returns an empty list if the container cannot be read.
| Parameter | Type | Description |
|---|---|---|
domain | ||
limit | integer |
list_sites List Sites
List the Active Directory sites (audit). Reads `site` objects from `CN=Sites,CN=Configuration,<forest root>`. The Configuration naming context is derived from the domain base for a single-domain forest; pass `config_base` explicitly for a multi-domain forest. Returns an empty list if the container cannot be read.
| Parameter | Type | Description |
|---|---|---|
config_base | ||
domain | ||
limit | integer |
list_subnets List Subnets
List the Active Directory subnets (audit). Reads `subnet` objects from `CN=Subnets,CN=Sites,CN=Configuration,<forest root>`. Each subnet's `cn` is its network prefix in CIDR form (e.g. `10.20.0.0/16`) and `siteObject` is the DN of the associated site. Pass `config_base` explicitly for a multi-domain forest. Returns an empty list if the container cannot be read.
| Parameter | Type | Description |
|---|---|---|
config_base | ||
domain | ||
limit | integer |
get_site Get Site
Get a single Active Directory site by its `cn` (name) (audit). Reads one `site` object from `CN=Sites,CN=Configuration,<forest root>`. Pass `config_base` explicitly for a multi-domain forest. Returns `null` if no site matches.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | |
config_base | ||
domain |
get_subnet Get Subnet
Get a single Active Directory subnet by its `cn` (CIDR) (audit). Reads one `subnet` object (e.g. `10.20.0.0/16`) from `CN=Subnets,CN=Sites, CN=Configuration,<forest root>`; the result includes `siteObject`. Pass `config_base` explicitly for a multi-domain forest. Returns `null` if no subnet matches.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | |
config_base | ||
domain |
list_site_links List Site Links
List the Active Directory site links (audit). Reads `siteLink` objects from `CN=Inter-Site Transports,CN=Sites, CN=Configuration,<forest root>`: the sites they connect, cost and replication interval. Pass `config_base` explicitly for a multi-domain forest. Returns an empty list if the container cannot be read.
| Parameter | Type | Description |
|---|---|---|
config_base | ||
domain | ||
limit | integer |
list_servers List Servers
List the directory servers (domain controllers) by site (audit). Reads `server` objects under `CN=Sites,CN=Configuration,<forest root>` — the site-centric view of the forest's DCs. Pass `config_base` explicitly for a multi-domain forest. Returns an empty list if the container cannot be read.
| Parameter | Type | Description |
|---|---|---|
config_base | ||
domain | ||
limit | integer |
list_replication_connections List Replication Connections
List the AD replication topology: inbound `nTDSConnection` objects (audit). Each entry has the decoded `destination_dc`, `site`, `source_dc`, `source_site` and `kcc_generated` (False = manually created), plus `enabledConnection`. This is topology, not live sync status/lag. Pass `config_base` explicitly for a multi-domain forest.
| Parameter | Type | Description |
|---|---|---|
config_base | ||
domain | ||
limit | integer |
list_replication_conflicts List Replication Conflicts
List replication-conflict objects (names containing `\0ACNF:<guid>`) (audit). These appear when two DCs create the same name concurrently and are a sign of replication problems; they should be reviewed and cleaned up.
| Parameter | Type | Description |
|---|---|---|
domain | ||
limit | integer |
first_look First Look
One-call overview of the domain/forest (audit). Returns domain info, password policy, FSMO owners, domain controllers, sites, trusts, replication connections and conflicts, plus a `summary` (counts and `warnings`) and `errors` for any section that could not be read. Good first call when exploring an unfamiliar domain.
| Parameter | Type | Description |
|---|---|---|
config_base | ||
domain |
list_dns_zones List Dns Zones
List the AD-integrated DNS zones (audit). Reads `dnsZone` objects from `DC=DomainDnsZones,<base>` by default; pass `zone_base` to target the forest-wide partition (`DC=ForestDnsZones, <forest root>`) or the legacy System container. Only AD-integrated zones are visible over LDAP; file-backed zones are not. Returns an empty list if the partition cannot be read.
| Parameter | Type | Description |
|---|---|---|
domain | ||
limit | integer | |
zone_base |
list_dns_records List Dns Records
List the DNS records of an AD-integrated zone (audit). Reads `dnsNode` objects of the given `zone` (e.g. `example.com`). The binary `dnsRecord` values are decoded (A/AAAA/NS/CNAME/PTR/MX/SRV/SOA/TXT) into a `dnsRecord_decoded` field. Pass `zone_base` to target a non-default partition. Returns an empty list if the zone cannot be read.
| Parameter | Type | Description |
|---|---|---|
zone * | string | |
domain | ||
limit | integer | |
zone_base |
list_authorized_dhcp_servers List Authorized Dhcp Servers
List the DHCP servers authorized in AD (audit). Reads `dHCPClass` objects from `CN=NetServices,CN=Services,CN=Configuration, <forest root>`. This reflects only which DHCP servers are authorized in the directory; scopes, pools, leases and reservations are not exposed over LDAP. Pass `config_base` explicitly for a multi-domain forest. Returns an empty list if the container cannot be read.
| Parameter | Type | Description |
|---|---|---|
config_base | ||
domain | ||
limit | integer |
list_dfs_namespaces List Dfs Namespaces
List the domain-based DFS namespace roots (audit). Reads `fTDfs` objects under `CN=Dfs-Configuration,CN=System,<base>`. Each root's `cn` is the namespace name; the binary topology blob (`pKT`) is not decoded. Stand-alone DFS namespaces are not stored in AD. Returns an empty list if the container cannot be read.
| Parameter | Type | Description |
|---|---|---|
domain | ||
limit | integer |
list_domain_controllers List Domain Controllers
List the domain controllers (computer accounts flagged as DCs). Matches the `SERVER_TRUST_ACCOUNT` userAccountControl flag. Returns the usual computer attributes for each DC.
| Parameter | Type | Description |
|---|---|---|
domain | ||
limit | integer |
list_empty_groups List Empty Groups
List groups with no direct members (hygiene/audit). Matches groups whose `member` attribute is unset. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_security_groups Find Security Groups
List security-enabled groups (as opposed to distribution groups). Pass `scope` to restrict to one group scope: "global", "domain_local" or "universal" (None returns security groups of any scope). Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer | |
scope |
find_distribution_groups Find Distribution Groups
List distribution groups (complement of find_security_groups). Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
find_admin_count_groups Find Admin Count Groups
Find groups with adminCount=1 (current or stale protected-group marker). Complement of find_admin_count_accounts on the group side: AD sets adminCount=1 via AdminSDHolder on groups protected by nesting under Domain Admins, Enterprise Admins, Schema Admins, etc. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
summarize_computer_os Summarize Computer Os
Summarize computer accounts grouped by operating system (audit/report). Returns `{operatingSystem, count}` rows sorted by descending count; computers without an `operatingSystem` are grouped under `(unknown)`. Pass `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
domain | ||
limit | integer |
list_gpos List Gpos
List Group Policy Objects (audit). Reads `groupPolicyContainer` objects under `CN=Policies,CN=System,<base>`. Each GPO's `cn` is its GUID and `displayName` the friendly name. Returns an empty list if the Policies container cannot be read.
| Parameter | Type | Description |
|---|---|---|
domain | ||
limit | integer |
get_gpo Get Gpo
Get a single Group Policy Object by its `cn` (GUID) or `displayName`. The GUID may be given with or without braces. Returns None if not found.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | |
domain |
list_fine_grained_password_policies List Fine Grained Password Policies
List fine-grained password policies (PSOs) (audit). Reads `msDS-PasswordSettings` objects under `CN=Password Settings Container,CN=System,<base>`. Reading them may require extra directory rights; returns an empty list if the container is not readable.
| Parameter | Type | Description |
|---|---|---|
domain | ||
limit | integer |
find_recently_modified Find Recently Modified
Find objects whose whenChanged is within the last `days` days (default 7). Useful for a "what changed recently in AD" audit. Pass `object_class` (e.g. "user", "group", "computer") to restrict to one object type, and `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
days | integer | |
domain | ||
limit | integer | |
object_class |
find_recently_created Find Recently Created
Find objects whose whenCreated is within the last `days` days (default 7). Pass `object_class` (e.g. "user", "group", "computer") to restrict to one object type, and `base` (a DN) to scope to an OU.
| Parameter | Type | Description |
|---|---|---|
base | ||
days | integer | |
domain | ||
limit | integer | |
object_class |
search_ldap Search Ldap
Run a raw LDAP search with a custom filter (read-only, power-user escape hatch). Use this when the typed tools (`find_users`, `find_groups`, ...) don't cover a query. The `search_filter` is passed to LDAP verbatim, so it must be a valid, already-escaped RFC 4515 filter, e.g. `(&(objectClass=user)(title=Manager))` or `(&(objectClass=group)(!(member=*)))` for empty groups.
| Parameter | Type | Description |
|---|---|---|
search_filter * | string | a raw LDAP filter (used as-is; escape any user input). |
attributes | attributes to return (defaults to all attributes). | |
base | DN to search under (defaults to the domain base). | |
domain | ||
include_deleted | boolean | also return deleted objects (search under the domain base or `CN=Deleted Objects,<base>`; needs read access). |
limit | integer | max entries to return (default 100; 0 = no limit). |
reverse | boolean | reverse the `sort_by` order. |
scope | string | "subtree" (default), "level" (direct children only) or "base" (the base object only). |
sort_by | attribute to sort the returned entries by (applied after `limit`); entries lacking it come last. |