I've installed the free Quest AD tools and running the following PS command to get all the SIDs in a group.
Get-QADGroupMember 'My Test Group' | select Sid
Sid
---
S-1-5-21-3362478587-226510628-1547701939-1121
S-1-5-21-3362478587-226510628-1547701939-1129
This looks good. When I run this code I get a strange format
$Group = "My Test Group"
$GroupMembers = Get-QADGroupMember -IncludeAllProperties $Group | select Sid
foreach ($member in $GroupMembers)
{
Write-Host $member
}
Here's what the output looks like. Basically I want to be able to create a folder for each SID. This is what looks strange. What is the @Sid={} stuff? How can I get rid of it. Maybe you know of a better way to accomplish what I want to do.
@Sid={S-1-5-21-3362478587-226510628-1547701939-1121}
@Sid={S-1-3362478587-226510628-1547701939-1129}