ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS for Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcMap

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

DisconnectUser

  • サマリー
  • 説明
  • 構文
  • コードのサンプル

サマリー

Allows an administrator to disconnect users who are currently connected to an enterprise geodatabase.

説明

The DisconnectUser function is used by an administrative user to disconnect users from an enterprise geodatabase. This function is used to complement the Connected users dialog box found in ArcGIS Desktop.

  • The DisconnectUser function must utilize an administrative connection to the database.
  • If this function is attempted to be run by a nonadministrative user the function will fail.
  • Selecting all users will disconnect all users other than the administrator connection used to execute the function or database.

構文

DisconnectUser (sde_workspace, {users})
パラメーター説明データ タイプ
sde_workspace

The enterprise geodatabase containing the users to be disconnected.

The connection properties specified in the enterprise geodatabase must have administrative rights that allow the user to disconnect other connections.

String
users
[users,...]

Specifies which users will be disconnected from the geodatabase.

  • sde_id —The ID value returned from the ListUsers function. This can be passed to the function as an individual sde_id or a list containing multiple sde_ids.
  • ALL —Keyword specifying that all connected users should be disconnected.
注意:

DisconnectUser will not disconnect the user who is executing the function.

Integer

コードのサンプル

DisconnectUser example 1

The following example demonstrates how to disconnect all users from a geodatabase.

import arcpy

arcpy.DisconnectUser("Database Connections/admin@sde.sde", "ALL")
DisconnectUser example 2

The following example demonstrates how to run the command to disconnect a single user. In this example, the SDE ID is extracted based on the name of the user that the admin would like to disconnect from the list returned from the ListUsers function.

import arcpy

admin_workspace = "Database Connections/tenone@sde.sde"
arcpy.env.workspace = admin_workspace
user_name = "GDB"

# Look through the users in the connected user list and get the SDE ID.
# Use the SDE ID to disconnect the user that matches the username variable
users = arcpy.ListUsers() # The environment is set, no workspace is needed.
for item in users:
    if item.Name == user_name:
        arcpy.DisconnectUser(admin_workspace, item.ID)
DisconnectUser example 3

The following example demonstrates how to run the DisconnectUser command to disconnect multiple users.

import arcpy

# Set the admistrative workspace connection
admin_workspace = "Database Connections/tenone@sde.sde"

# Create a list of users to disconnect.
user_names = ["TRAVIS", "DEBBIE", "PHIL"]

# Get a list of connected users
connected_users = arcpy.ListUsers(admin_workspace)

# Loop through the list of connected users and execute DisconnectUser
# if the user name is in the userNamesList created earlier:
for user in connected_users:
    if user.Name in user_names:
        print('Disconnecting {0}'.format(user.Name))
        arcpy.DisconnectUser(admin_workspace, user.ID)

関連トピック

  • AcceptConnections
  • ListUsers

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS プラットフォーム

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • Esri ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
Copyright © 2019 Esri. | プライバシー | リーガル