Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per utilizzare l'API Chrome Printer Management, devi attivarla e creare le credenziali OAuth 2.0 dell'app. Quindi, un
amministratore di Chrome
deve concedere allo script l'accesso all'account necessario per gestire le stampanti.
Gli amministratori possono facoltativamente bloccare o considerare attendibili le app sviluppate per gestire le stampanti per il loro account.
Segui i passaggi riportati di seguito per configurare tutto ciò che è necessario per l'accesso all'API. Queste istruzioni presuppongono che tu abbia già configurato un'app con la relativa schermata per il consenso OAuth e un account di servizio. In caso contrario, consulta
Configurare il consenso OAuth e
Creare un account di servizio
prima di continuare.
Attiva l'API e crea le credenziali
Attiva l'API.
L'API che stai attivando è "SDK Admin".
Crea le credenziali OAuth 2.0
per il tuo account di servizio. Memorizza il file JSON scaricato in una posizione sicura.
Abilita l'accesso all'account di servizio
Prima dell'utilizzo, all'account di servizio devono essere concessi i privilegi amministrativi appropriati. Questa operazione deve essere eseguita da un amministratore per il cliente associato alle stampanti o ai server di stampa gestiti dal service account.
Opzione 1: attiva la delega a livello di dominio per l'account di servizio
La delega a livello di dominio consente all'account di servizio di rubare l'identità di un amministratore che possiede i privilegi appropriati per gestire stampanti e server di stampa.
L'ambito OAuth necessario per questo passaggio è
https://www.googleapis.com/auth/admin.chrome.printers.
Opzione 2: concedi i privilegi del ruolo amministrativo all'account di servizio
Se preferisci limitare i privilegi dell'account di servizio nel dominio, puoi assegnatogli un ruolo con privilegi per gestire solo le stampanti. Per scoprire di più sull'utilizzo dei ruoli per il controllo dell'accesso, consulta Gestire i ruoli.
In alto a sinistra nella pagina, fai clic su
menu > Account > Ruoli
amministratore.
Seleziona un ruolo esistente con il privilegio di seguito oppure crea un nuovo ruolo e
aggiungi questo privilegio:
Services > ChromeOS > Settings > Manage Printers
Assegna questo ruolo all'indirizzo email dell'account di servizio.
Bloccare o considerare attendibile un'app di gestione della stampante
Le app sono attendibili per impostazione predefinita, ma un amministratore può scegliere di bloccare o considerare attendibili app specifiche per il proprio account.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-03-25 UTC."],[],[],null,["# Get started\n\nTo use the Chrome Printer Management API, you need to enable the API and create the app's OAuth\n2.0 credentials. Then a\n[Chrome administrator](https://support.google.com/a/answer/6208960)\nneeds to grant your script the necessary account access to manage printers.\nAdmins can optionally block or trust apps developed to manage printers\nfor their account.\n\nFollow the steps below to set up everything required for API access. These\ninstructions assume you already have an app with its OAuth consent screen set\nup, and a service account set up. If that's not the case, see\n[Configure OAuth consent](/workspace/guides/configure-oauth-consent) and\n[Create a service account](/workspace/guides/create-credentials#create_a_service_account)\nbefore continuing.\n| **Note:** Only service accounts can access the Chrome Printer Management API at this time.\n\nEnable API and create credentials\n---------------------------------\n\n1. [Enable the API](/workspace/guides/enable-apis). The API you are enabling is \"Admin SDK.\"\n2. [Create OAuth 2.0 credentials](/workspace/guides/create-credentials#create_credentials_for_a_service_account) for your service account. Store the downloaded JSON file in a secure location.\n\nEnable service account access\n-----------------------------\n\nBefore use, your service account needs to be granted proper admin\nprivileges. This must be done by an administrator for the customer\nassociated with the printers or print servers that the service account manages.\n\n### Option 1: Enable domain-wide delegation for the service account\n\nDomain-wide delegation lets the service account impersonate an admin who\nhas the proper privileges to manage printers and print servers.\n\n[Enable domain-wide delegation](/workspace/guides/create-credentials#optional_set_up_domain-wide_delegation_for_a_service_account)\n\nThe OAuth scope you need for this step is\n`https://www.googleapis.com/auth/admin.chrome.printers`.\n| **Note:** Depending on your app, you might need to enter additional scopes. For example, you might need to list scopes for the [Chrome Policy API](/chrome/policy)or the [Directory API](/workspace/admin/directory) (to view or manage organizational units).\n\n### Option 2: Grant admin role privileges to the service account\n\nIf you prefer to limit the service account's privileges on the domain, you can\nassign it a role with privileges to only manage printers. To learn more about\nusing roles for access control, see\n[Manage roles](/workspace/admin/directory/v1/guides/manage-roles).\n\n1. As an administrator, sign in to the [Admin console](https://admin.google.com/).\n2. At the top left of the page, click menu \\\u003e **Account** \\\u003e **Admin\n roles**.\n3. Select an existing role with the privilege below, or create a new role and\n add this privilege:\n\n `Services \u003e ChromeOS \u003e Settings \u003e Manage Printers`\n4. Assign this role to the service account email address.\n\nBlock or trust a printer management app\n---------------------------------------\n\nApps are trusted by default, but an administrator can choose to block or trust\nspecific apps for their account.\n\n1. As an administrator, sign in to the [Admin console](https://admin.google.com/).\n2. At the top left, click Menu menu \\\u003e **Security** \\\u003e **Access and data control** \\\u003e **API controls**.\n3. In the \"App access control\" section, click **Manage Third-party App Access**.\n4. In the \"Connected apps\" section:\n - If you don't see the app listed, click **Configure new app**. Then, follow the on-screen instructions.\n - If you see the app listed, click the app name. Then, select blocked or trusted under \"App Access\" and click **Save**."]]