Group membership in multiple columns
i have created script shows in msun group. have column indicates whether user in group, , display group name output.
how should change script can see if user member of group?
get-aduser -filter {enabled -eq $true} -searchbase “my ou” -properties * | select-object name, @{n='canonicalname';e={($_.canonicalname -split "/")[-2]}}, @{n='memberof';e={($_.memberof -like "*msol*" -replace '^cn=([^,]+),ou=.+$','$1' )}}, @{n='lastlogon';e={[datetime]::fromfiletime($_.lastlogon)}}
just add column test second group did first one.
\_(ツ)_/
Windows Server > Windows PowerShell
Comments
Post a Comment