# IRPCVaultLoginsAdmin.GetOrganizationalUnitsForDomainInVault

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Vault login accounts](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultLoginsAdmin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultLoginsAdmin/GetOrganizationalUnitsForDomainInVault/

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Lists the organizational units of a domain.

- **Service:** [Vault login accounts](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultLoginsAdmin/index.md) `MFiles.IRPCVaultLoginsAdmin`
- **gRPC method:** `/MFiles.IRPCVaultLoginsAdmin/GetOrganizationalUnitsForDomainInVault`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-organizational-units-for-domain-in-vault`
- **Request:** [`GetOrganizationalUnitsForDomainInVaultRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultLoginsAdmin/GetOrganizationalUnitsForDomainInVault/index.md#request)
- **Response:** [`GetOrganizationalUnitsForDomainInVaultResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultLoginsAdmin/GetOrganizationalUnitsForDomainInVault/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires the vault right `manage_users`. Use the result to narrow
  [GetWindowsGroupsInVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultLoginsAdmin/GetWindowsGroupsInVault/index.md).

<a id="request"></a>

## Request: GetOrganizationalUnitsForDomainInVaultRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `domain` | `string` | The domain name in NT format, for example `CONTOSO`. |

<a id="response"></a>

## Response: GetOrganizationalUnitsForDomainInVaultResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `ous[]` | repeated [`DirectoryItem`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DirectoryItem/index.md) | The organizational units. See [DirectoryItem](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.DirectoryItem/index.md). |
| `ous[].distinguished_name` | `string` | The distinguished name of the directory item, e.g. "CN=gr01,OU=orgunit,DC=domain,DC=com" |
| `ous[].display_name` | `string` | Name of the directory object as displayed in user interface. |

<a id="related"></a>

## Related methods

- [GetWindowsGroupsInVault](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultLoginsAdmin/GetWindowsGroupsInVault/index.md): Lists Windows groups of the server's domains, for importing users by group.
