Runbook
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
Hi.
three steps to figure out the problem:
1)
2) choose a default $user and $group where u know the result.
3) Test your script in Powershell without SCORCH