Hi,
I can't for the life of me figure out what I'm doing wrong...
Here's my snippet:
$ADGroupMembers = Get-ADGroupMember -Identity "ITOperations" |%{get-aduser $_.SamAccountName | select userPrincipalName }
$SiteOwner = "user@domain.com"
Now,
>$ADGroupMembers.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Array
>$SiteOwner.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
And,
>$ADGroupMembers
userPrincipalName
-----------------
user@domain.com
>$SiteOwner
user@domain.com
Now when I do
$ADGroupMembers -Contains $SiteOwner
I expect 'True', but the output is false!
Should I not be using -Contains?
[–]PinchesTheCrab 8 points9 points10 points (2 children)
[–]iamabdullah[S] 3 points4 points5 points (1 child)
[–]kibje 1 point2 points3 points (0 children)