---
title: "Using the admin Object"
url: https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object
language: cpp
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Using the admin Object

Programming language: C++. Other languages: [C#](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object/java.md), [JavaScript](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object/js.md), [MATLAB](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object/php.md), [Python](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object/ruby.md), [Swift](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/using-the-admin-object/swift.md).

A program can obtain a proxy for its `admin` object by calling `getAdmin` on its communicator. This method creates the `admin` object if it does not exist yet, as described in [Creating the admin Object](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/creating-the-admin-object/cpp.md). It returns a null proxy when the administrative facility is disabled, or when the `admin` object does not exist and `Ice.Admin.Endpoints` is not set.

The `admin` object has no default [facet](https://docs.zeroc.com/ice/3.8/runtime/facets/cpp.md), so a program cannot invoke operations on a proxy for the `admin` object itself; it must first obtain a proxy for one of its facets.

To administer a program remotely, somehow you must obtain a proxy for the program's `admin` object. There are several ways for the administrative client to accomplish this:

- Construct the proxy itself, assuming that it knows the admin object's identity, facets, and endpoints. The format of the [stringified proxy](https://docs.zeroc.com/ice/3.8/runtime/endpoint-syntax/cpp.md) is as follows: *adminId* -f *admin-facet*:*admin-endpoints* The identity, represented here by *adminId*, is *instance-name*/admin for admin objects created during communicator initialization or with `getAdmin`, where *instance-name* is the value of the [Ice.Admin.InstanceName](https://docs.zeroc.com/ice/3.8/property-reference/ice-admin-properties/cpp.md#ice.admin.instancename) property or a UUID if that property is not defined. (Clearly, the use of a UUID makes the proxy much more difficult for a client to construct on its own.) The name of the administrative facet is supplied as the value of the -f option, and the endpoints of the object adapter that hosts the admin object appear last in the proxy.
- Invoke an application-specific interface for retrieving the `admin` object's proxy.
- Use the `getServerAdmin` operation on the `IceGrid::Admin` interface, if the remote program was activated by IceGrid (see [IceGrid Server Activation](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-server-activation.md)).

Having obtained the proxy, the administrative client must select a facet before invoking any operations. For example, the code below shows how to obtain the configuration properties of the remote program:

```cpp
ObjectPrx admin = ...; // proxy to the admin object
auto propAdmin = admin.ice_facet<PropertiesAdminPrx>("Properties");
Ice::PropertyDict props = propAdmin.getPropertiesForPrefix("");
```

A remote client must also know (or be able to determine) which facets are available in the target server. Typically this information is statically configured in the client, since the client must also know the interface types of any facets that it uses. If an invocation on a facet throws `FacetNotExistException`, the client may have used an incorrect facet name, or the server may have disabled the facet in question.

## See Also

- [The admin Object](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/admin-object/cpp.md)
- [Creating the admin Object](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/creating-the-admin-object/cpp.md)
- [Ice.Admin.\*](https://docs.zeroc.com/ice/3.8/property-reference/ice-admin-properties/cpp.md)
- [Proxy and Endpoint Syntax](https://docs.zeroc.com/ice/3.8/runtime/endpoint-syntax/cpp.md)
