14.5Resources and operations
Last updated
The node offers nine resources. The tables below list every operation. The permission column names the permission the API key's role needs; Chapter 11, Users, roles and permissions, explains permissions.
User
| Operation | What it does | Permission |
|---|---|---|
| Get Many | Searches users under a Base DN, with an optional LDAP Filter and extra Properties to return. | ad:users:read |
| Get By ID | Reads one user. | ad:users:read |
| Search by State | Finds users in a given State (see below), optionally under a Base DN and with an Additional LDAP Filter. | ad:users:list |
| Get Groups | Lists the groups the user is a member of. With Recursive on, nested groups are followed and every group the user effectively belongs to is returned. Neither mode includes the primary group (normally Domain Users). | ad:groups:read |
| Get Authorization Groups | Lists every group in the account's access token (Account ID), including the primary group and well-known groups that a member-of read does not show. | ad:groups:read |
| Create | Creates a user with User Name, User Path (the container), User SAM Account Name, optional User Password, Account Policy and User Attributes. | ad:users:create |
| Update | Changes User Attributes and Account Policy flags, and changes the logon name when SAM Account Name is given. | ad:users:update |
| Enable / Disable | Enables or disables the account. | ad:users:update |
| Unlock | Clears a lockout. Safe to repeat; the output's wasLocked says whether the account was actually locked. | ad:users:update |
| Reset Password | Sets a new password without knowing the old one. | ad:users:update |
| Change Password | Changes the password by supplying the Current Password and New Password. It is enforced against password history and minimum age, unlike a reset. | ad:users:update |
| Set Account Expiration | Sets the date the account expires (Set Expiry Date with Expires At), or clears it (Clear Expiry). | ad:users:update |
| Assign Group / Assign Groups | Adds the user to one group, or to the groups listed in an array of the input item. | ad:groups:update |
| Unassign Group / Unassign Groups | Removes the user from one group, or from several. | ad:groups:update |
| Clear Groups | Removes the user from all groups it can be removed from. | ad:groups:update |
| Delete By ID | Deletes the user. | ad:users:delete |
Search by State accepts these states: Disabled, Enabled, Expired, Inactive, Locked Out, Password Expired, Password Must Change, Password Never Expires and Password Not Required. For Inactive, set Inactive Days to 15 or more: Active Directory updates the last-logon timestamp only about every 14 days, so a shorter period gives misleading results. Leave Base DN empty to search the whole domain.
For the operations that take several groups (Assign Groups, Unassign Groups), set Array Property to the name of the property in the input item that holds the array (default groups), and ID Key to the property inside each array element that holds the group's GUID (default id).
Note: The Reset Password operation shows a Must Change Password At Logon switch, but the gateway currently ignores it. To make the person choose a new password at their next sign-in, follow the reset with a User > Update that sets Account Policy > Change Password At Logon.
Group
| Operation | What it does | Permission |
|---|---|---|
| Get Many | Searches groups under a Base DN. | ad:groups:read |
| Get By ID | Reads one group. | ad:groups:read |
| Get Members | Lists the members. With Recursive on, nested groups are followed and only the leaf members are returned. | ad:groups:read |
| Create | Creates a group with Group Name, Path, Group Category (Security or Distribution), Group Scope (Global, Domain Local or Universal) and Group Attributes. | ad:groups:create |
| Update | Changes the group's attributes, and optionally its Group Category and Group Scope. | ad:groups:update |
| Assign Member / Assign Members | Adds one member (Member ID), or several from an array in the input item (Array Property, default members, and ID Key). | ad:groups:update |
| Unassign Member / Unassign Members | Removes one member, or several. | ad:groups:update |
| Clear Members | Removes every member. | ad:groups:update |
| Delete By ID | Deletes the group. | ad:groups:delete |
Computer
| Operation | What it does | Permission |
|---|---|---|
| Get Many | Searches computer accounts under a Base DN. | ad:computers:list |
| Get By ID | Reads one computer account. | ad:computers:read |
| Create | Creates a computer with Name, Path, SAM Account Name (a trailing $ is added if missing), optional Password, Account Policy and Computer Attributes. | ad:computers:create |
| Update | Changes Computer Attributes and Account Policy flags, and the logon name when SAM Account Name is given. | ad:computers:update |
| Enable / Disable | Enables or disables the computer account. | ad:computers:update |
| Reset Password | Sets a new password for the computer account. | ad:computers:update |
| Delete By ID | Deletes the computer account. | ad:computers:delete |
Organizational Unit
| Operation | What it does | Permission |
|---|---|---|
| Get Many / Get By ID | Searches or reads organizational units. | ad:ous:read |
| Create | Creates an organizational unit with Name, Path and Attributes. | ad:ous:create |
| Update | Changes attributes. | ad:ous:update |
| Delete By ID | Deletes the organizational unit. | ad:ous:delete |
| Preview Account Enable/Disable | Shows what enabling or disabling (Action) the accounts in the unit would change, without changing anything. | ad:ous:read, plus ad:users:read for users and ad:computers:list for computers |
| Enable Accounts / Disable Accounts | Enables or disables the accounts in the unit. | ad:ous:read, plus ad:users:read and ad:users:update for users, ad:computers:list and ad:computers:update for computers |
The three account operations take an OU ID, Account Kinds (Users, Computers or All) and Scope (Only This OU, or Include Sub-OUs). The preview returns toChange, alreadyInState, excluded (each with a reasonCode and a reason) and exceedsLimit.
Some accounts are never changed with their unit: domain controller accounts, the Kerberos service account (krbtgt), the built-in Administrator, Guest and DefaultAccount, and system-critical objects. A disable also leaves out the account the connection signs in with and the gateway server's own computer account. The preview lists them under excluded.
Important: Enabling or disabling all the accounts in a unit waits for a person's approval unless the API key is set to Act without asking.
At most 100 accounts are changed in one run. A larger selection is refused as a whole with OrganizationUnitAccounts.TooMany; it is never split. Narrow the kinds or the scope, or run the preview first and check exceedsLimit.
A run is not transactional: if some accounts fail, the others still change. The node then emits one item whose top level carries success (true only when nothing failed), partialFailure, total, succeeded and failed, with the per-account outcomes under batch.items. Branch on {{ $json.partialFailure }}, or turn on Fail on Partial Failure to make the item fail instead. Accounts that changed before a failure stay changed either way.
Object
The Object resource works with any directory object, including types without their own resource such as contacts.
| Operation | What it does | Permission |
|---|---|---|
| Get Many | Searches objects of an Object Type (Computer, Contact, Group, Organizational Unit or User) under a Path, with an optional LDAP Filter and Other Attributes to Select. | ad:objects:read |
| Get By ID | Reads one object by its ID, optionally with an Object Class and extra Properties. | ad:objects:read |
| Create | Creates an object of an Object Type with Object Name, Path and Attributes. | ad:objects:create |
| Update | Applies Attribute Patches: Add, Replace, Remove and Clear, each naming an attribute and, except for Clear, a value. | ad:objects:update |
| Move | Moves an object into New Parent Distinguished Name. | ad:objects:update, or the type's own update permission when Expected Class is set |
| Rename | Renames an object to New Object Name. | ad:objects:update, or the type's own update permission when Expected Class is set |
| Delete By ID | Deletes the object. | ad:objects:delete |
| Run Saved Search | Runs a saved LDAP filter chosen from Saved Filter Name or ID. | savedfilters:read, plus ad:objects:read (or savedfilters:execute when the search runs on the server) |
| Search by Saved Search | Runs a saved search on the server, chosen from Saved Search Name or ID. | savedfilters:execute |
Move and Rename have an optional Expected Class (Computer, Group, Organizational Unit or User). When it is set, the gateway refuses the operation if the ID belongs to an object of another class, so a wrong ID cannot move or rename the wrong object. This is strongly recommended for moves, because a move changes the object's distinguished name. Renaming changes only the object's name in the directory tree; it does not change the logon name (sAMAccountName or userPrincipalName).
Saved searches are the shared saved LDAP filters described in Chapter 8, Saved LDAP filters. The drop-down lists the filters the API key can see, which needs savedfilters:list. For a filter that covers all object types, or one without a base DN, Run Saved Search automatically runs it on the server.
Security
| Operation | What it does | Permission |
|---|---|---|
| Get ACL | Reads an object's access control list. Explicit Entries Only hides inherited entries. | ad:acl:read |
| Get Many Delegation Templates | Lists the named delegation templates. | ad:acl:read |
| Get Many Delegations | Reports which delegation templates are present on a container, per trustee. Complete Delegations Only hides partial matches. | ad:acl:read |
| Apply Delegation | Grants a trustee the rights a delegation Template defines on a container (Object ID). Choose the trustee with Trustee By, then Trustee Object ID or Trustee SID. | ad:acl:delegate; templates that amount to full control also need ad:acl:manage |
| Revoke Delegation | Removes the entries a delegation template defines for a trustee. | ad:acl:delegate |
| Set Deletion Protection | Turns "protect from accidental deletion" on or off for an organizational unit (Organizational Unit ID, Protect). | ad:acl:manage |
| Get Service Principal Names | Reads the SPNs of a user or computer (Object Class, Object ID). | ad:spn:manage |
| Set Service Principal Names | Replaces the complete set of SPNs on a user or computer. | ad:spn:manage |
Important: Apply a delegation to the narrowest container that covers the actual need. A password-reset delegation at the domain root reaches every account in the domain, including administrative ones. Writing an SPN makes the account a Kerberos service target.
Raw edits of individual access control entries, the owner and inheritance are deliberately not offered in the node. They are available only through the REST API (see Chapter 15).
Service Account
| Operation | What it does | Permission |
|---|---|---|
| Get Many | Lists service accounts of a Kind (Both, Group Managed or Standalone). Unusable Only returns only group managed accounts that name no password-retrieval principals, which no host can use. | ad:serviceaccounts:list |
| Get | Reads one account (Service Account ID), with the principals allowed to retrieve its password. | ad:serviceaccounts:read |
| Get KDS Readiness | Reports whether the domain has the KDS root key a group managed service account needs. | ad:serviceaccounts:list |
| Create | Creates a Group Managed (gMSA) or Standalone (MSA) account with a Name (up to 15 characters), optional Retrieval Principal IDs and Additional Fields. The kind cannot be changed later. | ad:serviceaccounts:create |
| Update | Changes the Description, DNS Host Name, Enabled state or Service Principal Names under Update Fields. Only the fields you add are changed. | ad:serviceaccounts:update |
| Delete | Deletes the account. Every service running as it stops authenticating. | ad:serviceaccounts:delete |
| Get Many Password Retrieval Principals | Lists who may retrieve a group managed account's password. | ad:serviceaccounts:read |
| Set Password Retrieval Principals | Replaces that list with Principal Object IDs and Principal SIDs. This hands out a usable credential. | ad:serviceaccounts:update |
| Get Many Computer Service Accounts | Lists the standalone accounts linked to a computer (Computer ID). | ad:serviceaccounts:read |
| Set Computer Link | Links or unlinks (Linked) a standalone account and a computer. Linking alone does not make the account usable: it still has to be installed on the machine itself. | ad:serviceaccounts:update |
Additional Fields on Create are Description, DNS Host Name, Managed Password Interval (Days), Path, SAM Account Name and Service Principal Names. For a group managed account, the Managed Password Interval (Days) defaults to 30 and cannot be changed afterwards: Active Directory fixes it at creation. If Path is empty, the account is created in the domain's Managed Service Accounts container. SAM Account Name defaults to the name, with a trailing $ added. A group managed account needs a DNS Host Name to be usable. Service principal names are entered as a comma-separated list.
Directory Context
These operations only read. They return information about the directory the binding points to, and need ad:directory:read.
| Operation | What it returns |
|---|---|
| Get Directory Context | The full directory context in one item. |
| Get Domain | The domain. |
| Get Forest | The forest, its domains, functional level and UPN suffixes. |
| Get Root DSE | The RootDSE, including the configuration and schema naming contexts. |
| Get Domain Controllers | The domain controllers with their site, roles and global catalog flag. |
| Get Sites / Get Subnets / Get Site Links | The replication topology. |
| Get Trusts | The domain trusts with their direction, type and SID filtering state. |
| Get Optional Features | Optional features such as the Active Directory Recycle Bin, and whether each is enabled. |
| Get KDS Root Keys | The KDS root keys needed before a group managed service account can be created. |
Operation
The Operation resource works with operations the gateway has queued for approval. It is how a workflow follows up a change that is waiting for a person.
| Operation | What it does |
|---|---|
| Get By ID | Reads one of your own operations by its Operation ID. |
| Get Waiting | Lists your own operations that are waiting for approval, with Return All, Limit and an optional Search on the operation name. |
| Wait for Approval | Polls an operation until it is decided, expires or the timeout passes. |
All three need operations:waiting:list, and they only ever show operations made with the same API key's owner — never anybody else's.
Last updated
Thank you for your feedback.