If strings starts with in PowerShell [duplicate] If strings starts with in PowerShell [duplicate] powershell powershell

If strings starts with in PowerShell [duplicate]


$Group is an object, but you will actually need to check if $Group.samaccountname.StartsWith("string").

Change $Group.StartsWith("S_G_") to $Group.samaccountname.StartsWith("S_G_").