PCだい「ちゅき」

気がつけば庶事手伝い

目次

Blog 利用状況

ニュース

・H24/01/02
 Microsoft MVPを受賞しました
・H23/11/18
 MCTの憂鬱さんと相互リンクを張っていただきました^^
・H23/09/10
 プログラミング生放送でスピーカーさせていただきました^^ ・H22/12/18
 わんくま同盟でスピーカしました^^
さて、来年はどんな年になるかな。予想が当たるといいなぁ。
・H22/07/17
 わんくま同盟でスピーカしました^^
技術系のセッションは久しぶり。VB! VB!
・H22/03/13
 Tech FieldersでLTのスピーカしました^^
・H21/12/12
 わんくま同盟でスピーカしました^^
最近はずっとLT担当だったので、ちょっと新鮮でした^^
・H20/11/18
 Tech Fielders セミナー 大阪の
 Lightning Talkで優勝しました^^
・H20/8/23
 わんくま同盟で2回目のスピーカしちゃいました
 WCFと戯れてみました^^
・H20/5/17
 わんくま同盟でスピーカしちゃいました^^
 ちゃんとスピーカー持参しましたよんw
・H20/2/22
 なめ猫の参加証もらいました^^
・H20/1/22
 テンプレートを変えてみました^^
・H19/7/23
 ACEプログラムで、ナップサックをもらった上、工具セットももらえることになりました^^
・H19/1/11
 1が並ぶ縁起の良い日に投稿開始!。今後ともお付き合いよろしくお願いします
・H18/10/29
 参加させていただきました^^
ド・初心者ですがどうぞよろしくお願いします。

↓うーん、仕事しろ^^;
Chukiの脳内メーター

Chukiの脳内メーター

書庫

日記カテゴリ

ギャラリ

コミュニティ

相互リンク

Windows OSとか Active Directoryのセキュリティーグループに所属するかを確認したい!

ここ最近、UiPathでイロイロ遊んでます。そこでUiPath (ja) Advent Calendar 2018に参加してみました。第二弾!

結論!

セキュリティー担保したいなら、Orchestrator買え。以上。


はじめに

UiPathを軽くみんなでお安く使用しようとすると、Node-Lockedライセンスという共有端末をみんなで使うライセンス形態があります。しかし!、この場合、どのユーザーでログインしても、端末に入っているすべてのロボットが見えてしまいます。つまり申請系と承認系のロボットが起動できてしまうという、監査人大喜びのツッコミどころができてしまいます。

そこで、ユーザーがActive DirectoryなりWindows OSのセキュリティーグループに所属しているかを確認するプログラムを作ってみます。

Active Directoryでは、グループの中にグループを突っ込めたりするので、単にグループのメンバーの一覧取得だと、ガッつり再帰かけないといけないので面倒すぎます。この時IADsGroupクラスのIsMember を使うのがいつものパターンです。

ではやってみる。

image

↑OrchestratorなしのNode Lockedライセンスだと、すべてのロボットがどのユーザーにログインしても見えて実行が可能

Orchestratorなしで頑張ってみる

まずは、参照の追加。DirectoryEntryは System.DirectoryServicesの参照を追加して…あれ?IADsGroupはCOMだけどどうやって参照するんだ?

image

XAMLで追加するのはあくまでclr-namespaceなので、きっぱりあきらめる。
ここで登場するのは、「カスタムアクティビティ

自分でもサクっとアクティビティを作れてしまうのがUiPathのいいところ。だって、まんまWFなんだもの。

■作業

1、プログラムを作成

2、パッケージを作成

3、UiPathに読込

4、使ってみる


1、プログラムを作成

新しい.クラスライブラリ(NET Framework)のプロジェクトを作って次の4つを参照追加

.NET
・System.Activities
・System.ComponentModel.Composition
・System.DirectoryServices
COM

・Active DS Type Library

(コードは最後に入れてます)


2、パッケージを作成

詳しい作成方法は、「カスタムアクティビティ」をごらんあれ

image

3、UiPathに読込

「パッケージを管理」から設定を押して、作成したパッケージの場所を追加してください。詳しくは(以下略
Activitiesペインに表示されるようになります

imageimageimage


4、使ってみる

ローカルコンピューターのAdministratorsグループにいるかを確認

TargetGroup:”Administrators”
TargetService:System.Environment.MachineName

image

image

成功!!!

こんなもん作ってメンテナンスするくらいなら、Orchestrator買いましょう^^;

以下、コード

Imports System.Activities
Imports System.ComponentModel
Imports System.DirectoryServices
Imports ActiveDs

Public Class IsGroupMember
     Inherits CodeActivity

    <Description("Domain | Domain\ComputerName | ComputerName")>
     <Category("Input")>
     <RequiredArgument>
     Public Property TargetService As InArgument(Of String)

    <Description("対象のグループ名")>
     <Category("Input")>
     <RequiredArgument>
     Public Property TargetGroupName As InArgument(Of String)

    <Description("結果")>
     <Category("Output")>
     <RequiredArgument>
     Public Property Result As OutArgument(Of Boolean)
     Protected Overrides Sub Execute(context As CodeActivityContext)
         Dim comInfo As DirectoryEntry = New DirectoryEntry("WinNT://" + TargetService.Get(context))
         Dim theGroup As DirectoryEntry = comInfo.Children.Find(TargetGroupName.Get(context), "group")
         Dim localgroup As IADsGroup = CType(theGroup.NativeObject, IADsGroup)
         Dim currentUser As String = "WinNT://" + System.Environment.UserDomainName + "/" + System.Environment.UserName

        Result.Set(context, localgroup.IsMember(currentUser))
     End Sub
End Class

投稿日時 : 2018年12月19日 21:00

Feedback

# Great post, thank for sharing 2019/01/03 12:56 Thomas

https://123gamesfree.com/tube-master/

# Excellent blog you've got here.. It's difficult to find high-quality writing like yours these days. I seriously appreciate people like you! Take care!! 2019/10/24 7:01 Excellent blog you've got here.. It's difficult to

Excellent blog you've got here.. It's difficult to find high-quality writing like
yours these days. I seriously appreciate people like
you! Take care!!

# Thanks for another informative website. Where else may I get that type of information written in such ann ideal means? I've a venture that I am just now running on, and I have been on the look outt for such information. 2019/10/27 8:50 Thanks for another informative website. Where els

Thanks for another informative website. Where else may I get thatt type of inforemation written in such an iideal means?
I've a venture that I am just now running on, and I have been on the look out for such information.

# Hey there, You've done an excellent job. I'll definitely digg it and personally suggest to my friends. I'm sure they will be benefited from this site. 2019/11/06 4:03 Hey there, You've done an excellent job. I'll def

Hey there, You've done an excellent job. I'll definitely digg it and personally suggest to my friends.

I'm sure they will be benefited from this site.

# Hey there, You've done an excellent job. I'll definitely digg it and personally suggest to my friends. I'm sure they will be benefited from this site. 2019/11/06 4:05 Hey there, You've done an excellent job. I'll def

Hey there, You've done an excellent job. I'll definitely digg it and personally suggest to my friends.

I'm sure they will be benefited from this site.

# Hey there, You've done an excellent job. I'll definitely digg it and personally suggest to my friends. I'm sure they will be benefited from this site. 2019/11/06 4:07 Hey there, You've done an excellent job. I'll def

Hey there, You've done an excellent job. I'll definitely digg it and personally suggest to my friends.

I'm sure they will be benefited from this site.

# Hey there, You've done an excellent job. I'll definitely digg it and personally suggest to my friends. I'm sure they will be benefited from this site. 2019/11/06 4:09 Hey there, You've done an excellent job. I'll def

Hey there, You've done an excellent job. I'll definitely digg it and personally suggest to my friends.

I'm sure they will be benefited from this site.

# Good blog! I really love how it is simple on my eyes and the data are well written. I am wondering how I might be notified when a new post has been made. I've subscribed to your RSS feed which must do the trick! Have a great day! 2019/11/14 6:59 Good blog! I really love how it is simple on my ey

Good blog! I really love how it is simple on my eyes
and the data are well written. I am wondering how I might be notified when a new post
has been made. I've subscribed to your RSS feed which must do the trick!
Have a great day!

# If you would like to improve your knowledge simply keep visiting this web page and be updated with the newest gossip posted here. 2019/11/18 9:21 If you would like to improve your knowledge simply

If you would like to improve your knowledge simply keep visiting this web
page and be updated with the newest gossip posted here.

# Thanks for some other excellent article. Where else may anybody get that kind of info in such a perfect way of writing? I have a presentation next week, and I'm at the search for such info. 2019/11/20 12:49 Thanks for some other excellent article. Where els

Thanks for some other excellent article. Where else may anybody get that kind of info
in such a perfect way of writing? I have a presentation next
week, and I'm at the search for such info.

# Hi there! I could have sworn I've visited this blog before but after looking at a few of the posts I realized it's new to me. Anyhow, I'm certainly pleased I found it and I'll be bookmarking it and checking back regularly! 2019/11/24 5:04 Hi there! I could have sworn I've visited this blo

Hi there! I could have sworn I've visited this blog before but after looking at a few of the posts I realized
it's new to me. Anyhow, I'm certainly pleased
I found it and I'll be bookmarking it and checking back regularly!

# A motivating discussion is worth comment. I do think that you need to write more about this topic, it may not be a taboo matter but typically people don't speak about these subjects. To the next! Cheers!! 2019/11/24 10:27 A motivating discussion is worth comment. I do th

A motivating discussion is worth comment.
I do think that you need to write more about this topic,
it may not be a taboo matter but typically people
don't speak about these subjects. To the next!

Cheers!!

# A motivating discussion is worth comment. I do think that you need to write more about this topic, it may not be a taboo matter but typically people don't speak about these subjects. To the next! Cheers!! 2019/11/24 10:28 A motivating discussion is worth comment. I do th

A motivating discussion is worth comment.
I do think that you need to write more about this topic,
it may not be a taboo matter but typically people
don't speak about these subjects. To the next!

Cheers!!

# A motivating discussion is worth comment. I do think that you need to write more about this topic, it may not be a taboo matter but typically people don't speak about these subjects. To the next! Cheers!! 2019/11/24 10:28 A motivating discussion is worth comment. I do th

A motivating discussion is worth comment.
I do think that you need to write more about this topic,
it may not be a taboo matter but typically people
don't speak about these subjects. To the next!

Cheers!!

# A motivating discussion is worth comment. I do think that you need to write more about this topic, it may not be a taboo matter but typically people don't speak about these subjects. To the next! Cheers!! 2019/11/24 10:29 A motivating discussion is worth comment. I do th

A motivating discussion is worth comment.
I do think that you need to write more about this topic,
it may not be a taboo matter but typically people
don't speak about these subjects. To the next!

Cheers!!

# I read this paragraph fully regarding the comparison of newest and preceding technologies, it's awesome article. 2019/11/25 15:43 I read this paragraph fully regarding the comparis

I read this paragraph fully regarding the comparison of newest and preceding technologies, it's awesome article.

# Fantastic site. A lot of helpful info here. I'm sending it to some pals ans also sharing in delicious. And obviously, thanks to your sweat! 2019/11/26 8:49 Fantastic site. A lot of helpful info here. I'm se

Fantastic site. A lot of helpful info here.
I'm sending it to some pals ans also sharing in delicious.
And obviously, thanks to your sweat!

# Just wish to say your article is as amazing. The clearness in your submit is just spectacular and that i could suppose you're a professional in this subject. Well along with your permission allow me to clutch your feed to stay up to date with drawing c 2019/12/06 6:13 Just wish to say your article is as amazing. The c

Just wish to say your article is as amazing.
The clearness in your submit is just spectacular and that i could suppose you're a professional in this subject.

Well along with your permission allow me to clutch
your feed to stay up to date with drawing close post. Thanks 1,000,000 and please continue the gratifying work.

# Just wish to say your article is as amazing. The clearness in your submit is just spectacular and that i could suppose you're a professional in this subject. Well along with your permission allow me to clutch your feed to stay up to date with drawing c 2019/12/06 6:16 Just wish to say your article is as amazing. The c

Just wish to say your article is as amazing.
The clearness in your submit is just spectacular and that i could suppose you're a professional in this subject.

Well along with your permission allow me to clutch
your feed to stay up to date with drawing close post. Thanks 1,000,000 and please continue the gratifying work.

# Just wish to say your article is as amazing. The clearness in your submit is just spectacular and that i could suppose you're a professional in this subject. Well along with your permission allow me to clutch your feed to stay up to date with drawing c 2019/12/06 6:18 Just wish to say your article is as amazing. The c

Just wish to say your article is as amazing.
The clearness in your submit is just spectacular and that i could suppose you're a professional in this subject.

Well along with your permission allow me to clutch
your feed to stay up to date with drawing close post. Thanks 1,000,000 and please continue the gratifying work.

# 5 I just won't Blood pressure was 1 2020/01/01 0:54 Typicalcat76

http://www.firstdrivegroup.com/%ef%bb%bffree-to-contact-newest-mature-dating-online-site/ where to meet asian seniors in las vegas http://teatrdroga.pl/no-fees-ever-senior-dating-online-sites-blogs.wankuma.com.pdf where to meet british singles in the usa http://www.haupt-sache.de/%ef%bb%bf50s-plus-mature-online-dating-service-completely-free/ where to meet singles in la totally free http://antaresdanza.com/free-senior-singles-dating-online-sites-blogs.wankuma.com.pdf where to meet senior citizens in germany

# As the admin of this website is working, no doubt very rapidly it will be famous, due to its feature contents. 2020/01/01 6:06 As the admin of this website is working, no doubt

As the admin of this website is working, no doubt very
rapidly it will be famous, due to its feature contents.

# As the admin of this website is working, no doubt very rapidly it will be famous, due to its feature contents. 2020/01/01 6:07 As the admin of this website is working, no doubt

As the admin of this website is working, no doubt very
rapidly it will be famous, due to its feature contents.

# As the admin of this website is working, no doubt very rapidly it will be famous, due to its feature contents. 2020/01/01 6:08 As the admin of this website is working, no doubt

As the admin of this website is working, no doubt very
rapidly it will be famous, due to its feature contents.

# As the admin of this website is working, no doubt very rapidly it will be famous, due to its feature contents. 2020/01/01 6:09 As the admin of this website is working, no doubt

As the admin of this website is working, no doubt very
rapidly it will be famous, due to its feature contents.

# 8 Or you can This will be 7 2020/01/02 3:58 Typicalcat56

https://www.dodeko.eu/blog/2019/12/18/%ef%bb%bfmost-legitimate-senior-dating-online-service-for-relationships/ truly free newest mature dating online services https://www.tennisclubrevel.fr/no-fee-newest-seniors-dating-online-site-blogs.wankuma.com.pdf ny mexican mature singles dating online website

# Hi, yes this article is in fact fastidious and I have learned lot of things from it about blogging. thanks. 2020/02/02 22:55 Hi, yes this article is in fact fastidious and I

Hi, yes this article is in fact fastidious and I have learned lot of things from it about blogging.
thanks.

# I have been absent for some time, but now I remember why I used to love this website. Thanks, I'll try and check back more often. How frequently you update your website? 2020/02/05 0:41 I have been absent for some time, but now I rememb

I have been absent for some time, but now I remember why I used to love
this website. Thanks, I'll try and check back more often. How frequently
you update your website?

# I comment each time I especially enjoy a article on a site or if I have something to contribute to the discussion. Usually it is triggered by the passion communicated in the article I read. And after this post Windows OSとか Active Directoryのセキュリティーグループに所属 2020/02/05 10:20 I comment each time I especially enjoy a article o

I comment each time I especially enjoy a article on a site or if I have something to
contribute to the discussion. Usually it is triggered by the passion communicated
in the article I read. And after this post Windows OSとか Active Directoryのセキュリティーグループに所属するかを確認したい!.
I was actually moved enough to post a thought :
-) I actually do have a few questions for you
if it's okay. Is it just me or do some of the comments look as if
they are written by brain dead individuals?
:-P And, if you are posting on additional sites, I'd like to keep up with everything new you have to post.
Would you list the complete urls of all your community sites like your linkedin profile,
Facebook page or twitter feed?

# Hey, you used to write fantastic, but the last few posts have been kinda boring... I miss your super writings. Past few posts are just a little bit out of track! come on! 2020/02/08 5:58 Hey, you used to write fantastic, but the last few

Hey, you used to write fantastic, but the last few posts have been kinda boring...

I miss your super writings. Past few posts are just a little bit out of track!
come on!

# I got what you intend, thanks for putting up. Woh I am happy to find this website through google. 2020/02/10 6:12 I got what you intend, thanks for putting up. Woh

I got what you intend, thanks for putting up. Woh I am happy to find this website through google.

# Hi, i think that i saw you visited my web site so i came to “return the favor”.I'm attempting to find things to enhance my web site!I suppose its ok to use some of your ideas!! 2020/04/02 22:39 Hi, i think that i saw you visited my web site so

Hi, i think that i saw you visited my web site so i came
to “return the favor”.I'm attempting to find things to enhance my web site!I suppose its ok to use some of your ideas!!

# Good website! I truly love how it is simple on my eyes and the data are well written. I am wondering how I might be notified whenever a new post has been made. I've subscribed to your feed which must do the trick! Have a great day! 2020/04/28 21:16 Good website! I truly love how it is simple on my

Good website! I truly love how it is simple on my eyes and the data are well written. I am wondering how I might be notified whenever a new post has been made.
I've subscribed to your feed which must do the trick!

Have a great day!

# I am not sure where you're getting your information, but good topic. I needs to spend some time learning much more or understanding more. Thanks for wonderful information I was looking for this info for my mission. 2020/04/29 17:57 I am not sure where you're getting your informatio

I am not sure where you're getting your information, but good topic.
I needs to spend some time learning much more or understanding more.
Thanks for wonderful information I was looking for this info for my mission.

# Heya i am for the first time here. I found this board and I find It really useful & it helped me out much. I hope to give something back and help others like you aided me. 2020/05/19 18:21 Heya i am for the first time here. I found this bo

Heya i am for the first time here. I found this board and I find It really useful & it helped me out
much. I hope to give something back and help others like you aided me.

# 2 If the socket UM is a 7 2020/05/23 2:55 old-people-meet

http://nikeladokun.com/2020/01/03/7416/ best place to meet singles over 50

タイトル  
名前  
Url
コメント