SyntaxFix
Write A Post
Hire A Developer
Questions
$Group is an object, but you will actually need to check if $Group.samaccountname.StartsWith("string").
$Group
$Group.samaccountname.StartsWith("string")
Change $Group.StartsWith("S_G_") to $Group.samaccountname.StartsWith("S_G_").
$Group.StartsWith("S_G_")
$Group.samaccountname.StartsWith("S_G_")