0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

AccessのVBAでActiveDirectoryからユーザーが属しているグループ一覧を取得

Last updated at Posted at 2023-05-17

概要

管理者グループに属しているユーザーなら、管理者用フォームを表示…
といったような条件分岐をしたい場合。

やり方

参照設定に『Active DS Type Library』を追加。
image.png

Accessファイルを開いているユーザーが属してるグループ一覧表示サンプル
Dim ad_system_info_ As New ADSystemInfo

Dim ldap_ As IADs
Set ldap_ = GetObject("LDAP://" & ad_system_info_.UserName)

Dim group_ As IADs
For Each group_ In ldap_.Groups
    Debug.Print group_.Name
Next

参考サイトさん

バージョン

Windows 10 Pro 22H2 19045.2965
Microsoft Access for Microsoft 365 MSO (バージョン 2304 ビルド 16.0.16327.20200) 32 ビット

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?