<!--
{
  "documentType" : "article",
  "framework" : "OpenDirectory",
  "identifier" : "/documentation/OpenDirectory/opendirectory-functions",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "OpenDirectory Functions"
}
-->

# OpenDirectory Functions

This document describes the functions, constants, and data types used to interact with Open Directory.

## Topics

### Working with the Open Directory Context

[`ODContextGetTypeID()`](/documentation/OpenDirectory/ODContextGetTypeID())

Returns the type ID for the Open Directory context.

### Working with Nodes

[`ODNodeCopyDetails(_:_:_:)`](/documentation/OpenDirectory/ODNodeCopyDetails(_:_:_:))

Returns a dictionary containing details about a node.

[`ODNodeCopyRecord(_:_:_:_:_:)`](/documentation/OpenDirectory/ODNodeCopyRecord(_:_:_:_:_:))

Returns a reference to a record of a node.

[`ODNodeCopySubnodeNames(_:_:)`](/documentation/OpenDirectory/ODNodeCopySubnodeNames(_:_:))

Returns the names of subnodes for a given node.

[`ODNodeCopySupportedAttributes(_:_:_:)`](/documentation/OpenDirectory/ODNodeCopySupportedAttributes(_:_:_:))

Returns an array of attribute types supported by a given node.

[`ODNodeCopySupportedRecordTypes(_:_:)`](/documentation/OpenDirectory/ODNodeCopySupportedRecordTypes(_:_:))

Returns an array of the record types supported by a given node.

[`ODNodeCopyUnreachableSubnodeNames(_:_:)`](/documentation/OpenDirectory/ODNodeCopyUnreachableSubnodeNames(_:_:))

Returns an array of the subnodes of a given node that are currently unreachable.

[`ODNodeCreateCopy(_:_:_:)`](/documentation/OpenDirectory/ODNodeCreateCopy(_:_:_:))

Returns a copy of an existing node.

[`ODNodeCreateRecord(_:_:_:_:_:)`](/documentation/OpenDirectory/ODNodeCreateRecord(_:_:_:_:_:))

Creates a record in a specified node with specified properties.

[`ODNodeCreateWithName(_:_:_:_:)`](/documentation/OpenDirectory/ODNodeCreateWithName(_:_:_:_:))

Returns a new node created with a specified name.

[`ODNodeCreateWithNodeType(_:_:_:_:)`](/documentation/OpenDirectory/ODNodeCreateWithNodeType(_:_:_:_:))

Returns a new node created with a specified type.

[`ODNodeCustomCall(_:_:_:_:)`](/documentation/OpenDirectory/ODNodeCustomCall(_:_:_:_:))

Returns the result of a custom call to a node.

[`ODNodeGetName(_:)`](/documentation/OpenDirectory/ODNodeGetName(_:))

Returns the name of a node.

[`ODNodeGetTypeID()`](/documentation/OpenDirectory/ODNodeGetTypeID())

Returns the type ID for an Open Directory node.

[`ODNodeSetCredentials(_:_:_:_:_:)`](/documentation/OpenDirectory/ODNodeSetCredentials(_:_:_:_:_:))

Sets credentials for interacting with a node.

[`ODNodeSetCredentialsExtended(_:_:_:_:_:_:_:)`](/documentation/OpenDirectory/ODNodeSetCredentialsExtended(_:_:_:_:_:_:_:))

Sets credentials for interacting with a node using a specified authentication method.

[`ODNodeSetCredentialsUsingKerberosCache`](/documentation/OpenDirectory/ODNodeSetCredentialsUsingKerberosCache)

Sets credentials for interacting with a node with the Kerberos cache.

### Working with Queries

[`ODQueryCopyResults(_:_:_:)`](/documentation/OpenDirectory/ODQueryCopyResults(_:_:_:))

Returns results from a query synchronously.

[`ODQueryCreateWithNode(_:_:_:_:_:_:_:_:_:)`](/documentation/OpenDirectory/ODQueryCreateWithNode(_:_:_:_:_:_:_:_:_:))

Creates a query with a node using provided parameters.

[`ODQueryCreateWithNodeType(_:_:_:_:_:_:_:_:_:)`](/documentation/OpenDirectory/ODQueryCreateWithNodeType(_:_:_:_:_:_:_:_:_:))

Creates a query for a particular node type using provided parameters.

[`ODQueryGetTypeID()`](/documentation/OpenDirectory/ODQueryGetTypeID())

Returns the type ID for an Open Directory query.

[`ODQueryScheduleWithRunLoop(_:_:_:)`](/documentation/OpenDirectory/ODQueryScheduleWithRunLoop(_:_:_:))

Retrieves results from a query asynchronously by scheduling the query in a run loop.

[`ODQuerySetCallback(_:_:_:)`](/documentation/OpenDirectory/ODQuerySetCallback(_:_:_:))

Sets the callback for an asynchronous query.

[`ODQuerySetDispatchQueue(_:_:)`](/documentation/OpenDirectory/ODQuerySetDispatchQueue(_:_:))

Retrieves results from a query asynchronously by adding the query to a dispatch queue.

[`ODQuerySynchronize(_:)`](/documentation/OpenDirectory/ODQuerySynchronize(_:))

Restarts a query, disposing of any results it has obtained.

[`ODQueryUnscheduleFromRunLoop(_:_:_:)`](/documentation/OpenDirectory/ODQueryUnscheduleFromRunLoop(_:_:_:))

Removes a query from a specified run loop.

### Working with Records

[`ODRecordAddMember(_:_:_:)`](/documentation/OpenDirectory/ODRecordAddMember(_:_:_:))

Adds a record as a member of a group record.

[`ODRecordAddValue(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordAddValue(_:_:_:_:))

Adds a value to an attribute of a record.

[`ODRecordChangePassword(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordChangePassword(_:_:_:_:))

Changes the password of a record.

[`ODRecordContainsMember(_:_:_:)`](/documentation/OpenDirectory/ODRecordContainsMember(_:_:_:))

Returns whether a group record contains a given record.

[`ODRecordCopyDetails(_:_:_:)`](/documentation/OpenDirectory/ODRecordCopyDetails(_:_:_:))

Returns the values of a record’s attributes.

[`ODRecordCopyPasswordPolicy`](/documentation/OpenDirectory/ODRecordCopyPasswordPolicy)

Returns the password policies of a record.

[`ODRecordCopyValues(_:_:_:)`](/documentation/OpenDirectory/ODRecordCopyValues(_:_:_:))

Returns the value of a single attribute of a record.

[`ODRecordDelete(_:_:)`](/documentation/OpenDirectory/ODRecordDelete(_:_:))

Deletes a record from a node and invalidates the record.

[`ODRecordGetRecordName(_:)`](/documentation/OpenDirectory/ODRecordGetRecordName(_:))

Returns the official name of a record.

[`ODRecordGetRecordType(_:)`](/documentation/OpenDirectory/ODRecordGetRecordType(_:))

Returns the type of a record.

[`ODRecordGetTypeID()`](/documentation/OpenDirectory/ODRecordGetTypeID())

Returns the type ID for a record.

[`ODRecordRemoveMember(_:_:_:)`](/documentation/OpenDirectory/ODRecordRemoveMember(_:_:_:))

Removes a record as a member from a specified group record.

[`ODRecordRemoveValue(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordRemoveValue(_:_:_:_:))

Removes a value from a record’s attribute.

[`ODRecordSetNodeCredentials(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordSetNodeCredentials(_:_:_:_:))

Sets node authentication credentials for a given record.

[`ODRecordSetNodeCredentialsExtended(_:_:_:_:_:_:_:)`](/documentation/OpenDirectory/ODRecordSetNodeCredentialsExtended(_:_:_:_:_:_:_:))

Sets node authentication credentials for a record using a specified authentication method.

[`ODRecordSetNodeCredentialsUsingKerberosCache`](/documentation/OpenDirectory/ODRecordSetNodeCredentialsUsingKerberosCache)

Sets credentials for interacting with a record’s node with the Kerberos cache.

[`ODRecordSetValue(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordSetValue(_:_:_:_:))

Sets one or more attribute values of a record.

[`ODRecordSynchronize(_:_:)`](/documentation/OpenDirectory/ODRecordSynchronize(_:_:))

Synchronizes a record with the directory to get current data and commit changes.

[`ODRecordVerifyPassword(_:_:_:)`](/documentation/OpenDirectory/ODRecordVerifyPassword(_:_:_:))

Verifies a given password for a record.

[`ODRecordVerifyPasswordExtended(_:_:_:_:_:_:)`](/documentation/OpenDirectory/ODRecordVerifyPasswordExtended(_:_:_:_:_:_:))

Verifies a given password for a record given a specified authentication method.

### Working with Sessions

[`ODSessionCopyNodeNames(_:_:_:)`](/documentation/OpenDirectory/ODSessionCopyNodeNames(_:_:_:))

Returns the names of nodes registered in a given session.

[`ODSessionCreate(_:_:_:)`](/documentation/OpenDirectory/ODSessionCreate(_:_:_:))

Creates a session to be passed to node functions.

[`ODSessionGetTypeID()`](/documentation/OpenDirectory/ODSessionGetTypeID())

Returns the type ID for a session.

### Data Types

[`ODAttributeType`](/documentation/OpenDirectory/ODAttributeType)

An Open Directory attribute type.

[`ODAuthenticationType`](/documentation/OpenDirectory/ODAuthenticationType)

An Open Directory authentication type.

[`ODContext`](/documentation/OpenDirectory/ODContext)

An Open Directory context type.

[`ODNodeRef`](/documentation/OpenDirectory/ODNodeRef)

An Open Directory node type.

[`ODQueryRef`](/documentation/OpenDirectory/ODQueryRef)

An Open Directory query type.

[`ODRecordRef`](/documentation/OpenDirectory/ODRecordRef)

An Open Directory record type.

[`ODSessionRef`](/documentation/OpenDirectory/ODSessionRef)

An Open Directory session type.

[`ODMatchType`](/documentation/OpenDirectory/ODMatchType)

An Open Directory match type.

[`ODNodeType`](/documentation/OpenDirectory/ODNodeType)

An Open Directory node type.

[`ODQueryCallback`](/documentation/OpenDirectory/ODQueryCallback)

A callback function called as results from a scheduled query are returned.

[`ODRecordType`](/documentation/OpenDirectory/ODRecordType)

An Open Directory record type.

### Constants

[Session Keys](/documentation/OpenDirectory/session-keys)

Keys used when specifying session information.

[Node Types](/documentation/OpenDirectory/1497602-node-types)

Open Directory node types.

[Match Types](/documentation/OpenDirectory/match-types)

Types of matches used for searches.

[Record Types](/documentation/OpenDirectory/record-types)

Types of Open Directory records.

[General Attribute Types](/documentation/OpenDirectory/general-attribute-types)

Types of Open Directory attributes.

[Configuration Attribute Types](/documentation/OpenDirectory/configuration-attribute-types)

Types of Open Directory attributes specifically for use with configure nodes.

[Authentication Types](/documentation/OpenDirectory/authentication-types)

Types of authentication available in Open Directory.

### Functions

[`ODNodeAddAccountPolicy(_:_:_:_:)`](/documentation/OpenDirectory/ODNodeAddAccountPolicy(_:_:_:_:))

[`ODNodeCopyAccountPolicies(_:_:)`](/documentation/OpenDirectory/ODNodeCopyAccountPolicies(_:_:))

[`ODNodeCopyPolicies(_:_:)`](/documentation/OpenDirectory/ODNodeCopyPolicies(_:_:))

[`ODNodeCopySupportedPolicies(_:_:)`](/documentation/OpenDirectory/ODNodeCopySupportedPolicies(_:_:))

[`ODNodeCustomFunction(_:_:_:_:)`](/documentation/OpenDirectory/ODNodeCustomFunction(_:_:_:_:))

[`ODNodePasswordContentCheck(_:_:_:_:)`](/documentation/OpenDirectory/ODNodePasswordContentCheck(_:_:_:_:))

[`ODNodeRemoveAccountPolicy(_:_:_:_:)`](/documentation/OpenDirectory/ODNodeRemoveAccountPolicy(_:_:_:_:))

[`ODNodeRemovePolicy(_:_:_:)`](/documentation/OpenDirectory/ODNodeRemovePolicy(_:_:_:))

[`ODNodeSetAccountPolicies(_:_:_:)`](/documentation/OpenDirectory/ODNodeSetAccountPolicies(_:_:_:))

[`ODNodeSetPolicies(_:_:_:)`](/documentation/OpenDirectory/ODNodeSetPolicies(_:_:_:))

[`ODNodeSetPolicy(_:_:_:_:)`](/documentation/OpenDirectory/ODNodeSetPolicy(_:_:_:_:))

[`ODRecordAddAccountPolicy(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordAddAccountPolicy(_:_:_:_:))

[`ODRecordAuthenticationAllowed(_:_:)`](/documentation/OpenDirectory/ODRecordAuthenticationAllowed(_:_:))

[`ODRecordCopyAccountPolicies(_:_:)`](/documentation/OpenDirectory/ODRecordCopyAccountPolicies(_:_:))

[`ODRecordCopyEffectivePolicies(_:_:)`](/documentation/OpenDirectory/ODRecordCopyEffectivePolicies(_:_:))

[`ODRecordCopyPolicies(_:_:)`](/documentation/OpenDirectory/ODRecordCopyPolicies(_:_:))

[`ODRecordCopySupportedPolicies(_:_:)`](/documentation/OpenDirectory/ODRecordCopySupportedPolicies(_:_:))

[`ODRecordPasswordChangeAllowed(_:_:_:)`](/documentation/OpenDirectory/ODRecordPasswordChangeAllowed(_:_:_:))

[`ODRecordRemoveAccountPolicy(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordRemoveAccountPolicy(_:_:_:_:))

[`ODRecordRemovePolicy(_:_:_:)`](/documentation/OpenDirectory/ODRecordRemovePolicy(_:_:_:))

[`ODRecordSecondsUntilAuthenticationsExpire(_:)`](/documentation/OpenDirectory/ODRecordSecondsUntilAuthenticationsExpire(_:))

[`ODRecordSecondsUntilPasswordExpires(_:)`](/documentation/OpenDirectory/ODRecordSecondsUntilPasswordExpires(_:))

[`ODRecordSetAccountPolicies(_:_:_:)`](/documentation/OpenDirectory/ODRecordSetAccountPolicies(_:_:_:))

[`ODRecordSetPolicies(_:_:_:)`](/documentation/OpenDirectory/ODRecordSetPolicies(_:_:_:))

[`ODRecordSetPolicy(_:_:_:_:)`](/documentation/OpenDirectory/ODRecordSetPolicy(_:_:_:_:))

[`ODRecordWillAuthenticationsExpire(_:_:)`](/documentation/OpenDirectory/ODRecordWillAuthenticationsExpire(_:_:))

[`ODRecordWillPasswordExpire(_:_:)`](/documentation/OpenDirectory/ODRecordWillPasswordExpire(_:_:))



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)