-
Hi p3dr0, Sorry for that alias. :) Here is a collection of code snippets that use WinNT moniker that you could find useful: # the domain groups membership $user = [ADSI]"WinNT://$env:userdomain/$username,user" $user.groups() | ForEach-Object {$_.GetType().InvokeMember('Name','GetProperty'...
-
This solution uses ADSI and the .NET Framework to retrieve the name of the user's primary group: $rootDN = ([adsi]"").distinguishedName $user = [adsi]("LDAP://CN=testuser,OU=Test," + $rootDN) $groupID = $user.primaryGroupID $arrSID = $user.objectSid.Value $SID = New-Object System...
-
Matt Freeman demonstrates some creative one-liner techniques for getting, filtering, selecting and grouping results using core PowerShell Cmdlets. Easy to master once you know what you are doing. Read more