2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【UiPath】ユーザアカウントのフルネームを取得する

Last updated at Posted at 2021-08-25

アカウントのフルネームを取得する手段です。
ユーザ名やドメイン名は"環境変数を取得"アクティビティとかEnvironmentクラスで簡単に取れますが、フルネームは取れません(たぶん)。
方法は色々ありそうですが、PowerShellを使うのがシンプルなので書き残しておきます。
image.png

PowerShell を呼び出し(Invoke Power Shell)のアクティビティを使います。
image.png

プロパティは以下の通りです。
TypeArgumentをStringに
スクリプト入力のチェックをオンに
出力にCollection<String>型の変数に
コマンド テキストに以下のコードを入力
"$dom = $env:userdomain; $usr = $env:username;([adsi]""WinNT://$dom/$usr,user"").fullname"
image.png

出力は配列で返ってくるので(0)を指定
image.png
image.png

完了です。お疲れ様でした。

参考

動作環境

  • UiPath Studio Pro 2021.6.0 Community License
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?