# Server administration (IRPCServerAdmin)

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)

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

Server-wide administration: master database backup and restore, vault backups, server activity,
gRPC endpoint certificates, notification (e-mail) settings, server users and the M-Files Manage
subscription.

Use this interface to perform administrative server-level operations
such as backing up and restoring the master database.

- **gRPC service:** `MFiles.IRPCServerAdmin`
- **Book and level:** [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md), specialized
- **Methods:** 21
- **Proto file:** [`mfiles/IRPCServerAdmin.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/IRPCServerAdmin.proto)

<a id="overview"></a>

## Overview

This is the service behind the server-level nodes of M-Files Admin. Almost every method needs a
login with the **system administrator** server role; only a few are open to other users. An
application rarely needs it; automation scripts that back up vaults or read the server activity
can use it.

**Sessions and rights.** A server-level session is enough (log in with `login_data.vault_guid` =
`{00000000-0000-0000-0000-000000000000}`); a vault session works as well, except where a method
says it needs one. Server rights ([ServerAccess](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ServerAccess/index.md)) are granted only to
logins with the system administrator server role; a vault administrator does not have them. A
missing server right fails with "Access denied. You do not have the server-level access
rights required by this operation." (error codes 0x800400A8 and 0x800407E4).

- **Back up and restore**:
  [BackUp](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUp/index.md) (vault or master database, runs as a job),
  [BackUpMasterDB](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUpMasterDB/index.md),
  [RestoreMasterDB](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/RestoreMasterDB/index.md).
- **Server activity** (the M-Files Admin dashboard):
  [GetServerActivityAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetServerActivityAsJSON/index.md),
  [ResetServerActivityBuffer](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/ResetServerActivityBuffer/index.md).
- **Vault database performance test** (vault session):
  [BeginPerformanceMeasurementsAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BeginPerformanceMeasurementsAsJSON/index.md),
  then
  [GetPerformanceMeasurementsAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetPerformanceMeasurementsAsJSON/index.md)
  until done, then
  [EndPerformanceMeasurementsAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/EndPerformanceMeasurementsAsJSON/index.md).
- **gRPC endpoint TLS and certificate**:
  [GetServerEndpointSettings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetServerEndpointSettings/index.md),
  [SetServerEndpointSettings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/SetServerEndpointSettings/index.md).
- **Notification e-mail settings**:
  [GetNotificationSettings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetNotificationSettings/index.md),
  [SetNotificationSettings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/SetNotificationSettings/index.md).
- **Server users** (server roles assigned to account names):
  [GetServerUsers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetServerUsers/index.md),
  [UpsertServerUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/UpsertServerUser/index.md),
  [RemoveServerUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/RemoveServerUser/index.md).
- **M-Files Manage subscription**:
  [GetSubscriptionInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetSubscriptionInfo/index.md),
  [JoinSubscriptionTest](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/JoinSubscriptionTest/index.md),
  [JoinSubscription](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/JoinSubscription/index.md),
  [ConnectToCloud](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/ConnectToCloud/index.md).
- **Process control**: [Shutdown](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/Shutdown/index.md).

Login accounts are managed with [IRPCLoginsAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLoginsAdmin/index.md), scheduled jobs
with [IRPCScheduledJobsAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/index.md).

<a id="methods"></a>

## Methods

| Method | Summary | Facts |
|---|---|---|
| [BackUp](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUp/index.md) | Starts a backup of a vault or of the master database as a server job and returns the job ID. | `admin` `session` |
| [BackUpMasterDB](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BackUpMasterDB/index.md) | Backs up the server's master database to a file on the server, and returns when the backup is complete. | `admin` `session` |
| [BeginPerformanceMeasurementsAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BeginPerformanceMeasurementsAsJSON/index.md) | Starts a database performance measurement in the session's vault and returns its ID. | `admin` `session` `idempotent` |
| [ConnectToCloud](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/ConnectToCloud/index.md) | Tells the server to fetch its licenses and login accounts from M-Files Manage so that it can start attaching its vaults. | `internal: not for applications` `admin` `session` |
| [EndPerformanceMeasurementsAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/EndPerformanceMeasurementsAsJSON/index.md) | Stops and removes a performance measurement started with [BeginPerformanceMeasurementsAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/BeginPerformanceMeasurementsAsJSON/index.md). | `admin` `session` `idempotent` |
| [GetNotificationSettings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetNotificationSettings/index.md) | Gets the server's notification settings and mail-sending configuration (without the SMTP password). | `admin` `session` `idempotent` |
| [GetPerformanceMeasurementsAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetPerformanceMeasurementsAsJSON/index.md) | Gets the current results of a vault database performance measurement as JSON. | `admin` `session` `idempotent` |
| [GetServerActivityAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetServerActivityAsJSON/index.md) | Gets recent server activity (connections, slowest calls, object changes, views, background processes) as a JSON document, for the M-Files Admin server activity dashboard. | `admin` `session` `idempotent` |
| [GetServerEndpointSettings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetServerEndpointSettings/index.md) | Gets the TLS setting and the certificate of the server's gRPC endpoint. | `admin` `session` |
| [GetServerUsers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetServerUsers/index.md) | Gets the server users: account names with server roles that are stored separately from login accounts. | `admin` `session` `idempotent` |
| [GetSubscriptionInfo](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetSubscriptionInfo/index.md) | Gets whether and how the server is connected to an M-Files Manage subscription. | `admin` `session` `idempotent` |
| [IsRunningOnNT4](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/IsRunningOnNT4/index.md) | Obsolete. Always returns false. | `admin` `session` |
| [JoinSubscription](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/JoinSubscription/index.md) | Joins the server to an M-Files Manage subscription. | `admin` `session` |
| [JoinSubscriptionTest](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/JoinSubscriptionTest/index.md) | Checks whether the server could join an M-Files Manage subscription, and lists the vaults that would prevent it. | `admin` `session` `idempotent` |
| [RemoveServerUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/RemoveServerUser/index.md) | Removes a server user, that is, the server roles stored for an account name. | `admin` `session` `idempotent` |
| [ResetServerActivityBuffer](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/ResetServerActivityBuffer/index.md) | Clears the server's in-memory activity buffer that [GetServerActivityAsJSON](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/GetServerActivityAsJSON/index.md) reads. | `admin` `session` `idempotent` |
| [RestoreMasterDB](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/RestoreMasterDB/index.md) | Replaces the server's master database with a master database backup file on the server. | `admin` `session` |
| [SetNotificationSettings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/SetNotificationSettings/index.md) | Sets the server's notification settings: whether notifications are on, the daily digest time, and the SMTP or OAuth 2.0 mail settings used to send them. | `admin` `session` `idempotent` |
| [SetServerEndpointSettings](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/SetServerEndpointSettings/index.md) | Changes the TLS setting and the certificate of the server's gRPC endpoint and restarts the endpoint. | `admin` `session` |
| [Shutdown](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/Shutdown/index.md) | Stops the M-Files Server process. | `admin` `session` |
| [UpsertServerUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCServerAdmin/UpsertServerUser/index.md) | Adds a server user or changes the server roles of an existing one. | `admin` `session` `idempotent` |
