Home Orchestrator

Runbook

Nely-Grace_DjouNely-Grace_Djou Customer IT Monkey ✭


Hello I have a runbook that I have to develop which consists in verifying if a user is part of an AD group. I use the get user and and get group activities I don't get any results but I don't know why. I used the following links:https://social.technet.microsoft.com/Forums/en-US/34cf527f-4336-4909-a3da-4487e16376bf/orchestrator-1801-and-memberof?forum=scogeneral.


then instead of using the activities i instead made a script but i still get nothing. here is my code

$user= "\`d.T.~Ed/{C3037A89-95A3-4957-8236-708050CE8B07}.Sam Account Name\`d.T.~Ed/"

$members = powershell {

 

import-module activedirectory

 

$groups = \`d.T.~Ed/{B94C4404-4F97-4167-AEF5-C809DCC32608}.value\`d.T.~Ed/

 

      Get-ADGroupMember -Identity $groups -Recursive | Select -ExpandProperty SamAccountName

 

 

   }

 

If ($members -contains $user) {

     $group= "Yes"

   } Else {

          $group= "No"

 

   }

Answers

Sign In or Register to comment.