---
schema_version: "1"
id: ab0d8261878c4a2e263b99f8dc8140eb5088140ecaa1b19706ec8953f884af74
title: 刷新或停用产品密钥
collection: tableau
version: current
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/current/zh-cn/desktopdeploy/desktop_deploy_cli_refresh_key.md
canonical_url: https://help.tableau.com/current/desktopdeploy/zh-cn/desktop_deploy_cli_refresh_key.htm
source_site: help.tableau.com
content_type: documentation
content_hash: d658816367d17617bc335dcfc6e673c524df654e198bde3fd15de66afd62bda1
description: Refresh or deactivate Tableau Desktop and Prep Builder product keys from the command line.
---
[跳转到主要内容](#main-content)

# 刷新或停用产品密钥

购买新订阅时，必须刷新产品密钥。如果要将 Tableau 产品转移到另一台计算机，或者需要将其从计算机中移除，您需要停用产品密钥。

有关 Tableau Prep 中支持的所有命令行选项的列表，请参见 [Tableau Prep 命令行参考](https://help.tableau.com/current/prep/zh-cn/prep_command_line_reference.htm)。

**注意：**如果使用 基于登录名的许可证管理 或授权运行 (ATR) 服务来管理 Tableau Desktop 许可证，则无需使用这些命令来刷新或停用 Tableau。有关 基于登录名的许可证管理 的详细信息，请参见 [license\_lblm.htm](https://help.tableau.com/current/server/zh-cn/license_lblm.htm "基于登录名的许可证管理")。有关 ATR 服务的详细信息，请参见[配置虚拟桌面支持](https://help.tableau.com/current/desktopdeploy/zh-cn/desktop_deploy_license_deactivate.htm)。

## 刷新产品密钥

如果您有旧的产品密钥，则在购买新订阅时必须刷新产品密钥。刷新产品密钥会使用反映新的过期日期的新日期更新产品密钥。

如果在过期日期之前刷新订阅（短期）产品密钥，则产品密钥不会更改，但过期日期将更改。产品密钥将在过期日期或不久之后更改。如果订阅（短期）产品密钥未刷新且已过期，Tableau 将停止工作，您必须在 Tableau 客户门户中激活新的产品密钥。

另一方面，如果产品密钥是永久的（旧版），并且其维护已过期，Tableau 将继续运行，但在续订维护之前，您将无法访问升级。续订维护后，请刷新现有产品密钥以更新其维护过期日期。产品密钥永远不会更改。

**注意：**如果 Tableau Desktop 处于脱机状态，则无法刷新产品密钥。如果在脱机模式下激活 Tableau Desktop，则必须从 Tableau 客户门户获取并激活新密钥。

若要使用命令行刷新 Tableau 产品密钥，请使用 `-refresh` 选项。

如果要使用自动化脚本刷新 Tableau Server，请参见 Tableau Server 帮助中的[自动执行许可任务](https://help.tableau.com/current/server/zh-cn/license_automating.htm)。

### Windows

使用 `-refresh` 选项和产品密钥运行 `tableau.exe`。例如：

`start/wait " "C:\Program Files\Tableau\Tableau <version>\bin\tableau.exe" -refresh`

### Mac

在 `/Applications` 路径中对 Tableau 对象运行 `-refresh` 选项：

`./Applications/Tableau.app/Contents/MacOS/Tableau -refresh`

## 使用零停机许可自动刷新产品密钥

从 Tableau 版本 2021.1 开始，连接到 Internet 的 Tableau Desktop 和 Tableau Prep Builder 用户可能不必手动刷新产品密钥。如果用户已登录 Tableau Desktop 或 Tableau Prep Builder，则从订阅到期前 14 天开始，无需任何操作即可自动刷新长期许可证。永久产品密钥不会自动刷新，必须使用“管理产品密钥”菜单选项手动刷新。

Tableau Desktop 和 Tableau Prep Builder 将尝试以无提示方式刷新活动产品密钥，并将在许可证设置为过期前 14 天警告用户（如果无提示刷新不成功）。Tableau 将尝试刷新产品密钥三次（在许可证到期前 14 天、2 天和 1 天），以反映由于订阅续订而延长的许可证结束日期。产品密钥不会刷新，除非在这些期间 Tableau Desktop 用户登录到 Tableau Desktop。对于每天未登录 Tableau Desktop 的用户，您必须使用“管理产品密钥”菜单选项刷新他们的产品密钥。

## 停用产品密钥

> [!TIP]
> 
> **注意：**如果要使用自动化脚本停用 Tableau Server 产品密钥，请参见 Tableau Server 帮助中的[自动执行许可任务](https://help.tableau.com/current/server/zh-cn/license_automating.htm)。

如果要将 Tableau Desktop 或 Tableau Prep Builder 转移到另一台计算机，或者需要将其从计算机中移除，您应停用产品密钥。

若要检索和停用 Tableau Desktop 或 Tableau Prep Builder 产品密钥，而不必将其从单独的计算机中手动移除，请从命令行启动 Tableau 并使用 `-return` 选项。此选项采用一个参数，即产品密钥。

如果使用授权运行 (ATR) 服务来管理 Tableau Desktop 许可证，则无需使用这些命令来刷新或停用 Tableau。若要了解有关 ATR 服务的详细信息，请参见[配置虚拟桌面支持](https://help.tableau.com/current/desktopdeploy/zh-cn/desktop_deploy_license_deactivate.htm)。

您还可以在卸载期间停用产品密钥（仅限 Windows 桌面）。有关详细信息，请参见[在卸载期间停用产品密钥（仅限 Windows 桌面）](#deactivate_uninstall)。

### Windows

使用 `-return` 选项和产品密钥运行 tableau.exe，如以下示例中所示：

`start/wait " "C:\Program Files\Tableau\Tableau <version>\bin\tableau.exe" -return <product_key>`

或

`start/wait " "C:\Program Files\Tableau\Tableau Prep Builder <version>\Tableau Prep Builder.exe" -return <product_key>`

### Mac

在 `/Applications` 路径中对 Tableau 对象运行 `-return` 选项：

`./Applications/Tableau.app/Contents/MacOS/Tableau -return <product_key>`

或

`"./Applications/Tableau Prep Builder <version>.app/Contents/MacOS/Tableau Prep Builder" -return <product_key>`

### 在卸载期间停用产品密钥（仅限 Windows 桌面）

在 Windows 上使用 `RECLAIMLICENSE=1` 安装程序选项卸载 Tableau Desktop 时，可以从命令行停用任何永久（或版本 2018.3 及更高版本中的订阅）产品密钥。

例如：

`tableauDesktop-64bit-2025-3-1.exe /uninstall /quiet /norestart ACCEPTEULA=1 RECLAIMLICENSE=1`

回收许可证时会使 Tableau Desktop 变为未许可状态，将激活返回给关联的产品密钥以供将来使用。Tableau.exe 在卸载开始时将运行 `-return` 命令以停用任何活动永久或短期产品密钥。