Community

Subscribe
Highlighted
Accepted Solution

how to - list groups for domainuser

I am trying to list all groups a domainuser is in - for example:

command whitehouse\obama

output:

whitehouse\obama is in groups sd_group,backup operators

I saw C:\PS>Get-NaDomainUser - but it is asking to input a group

I've also seen this: C:\PS>Get-NaGroup | Get-NaDomainUser - this just lists all domain users

Cheers

Re: how to - list groups for domainuser

Use the below command, Please check all other group also.

useradmin domainuser list -g Administrators

List of SIDS in Administrators

S-1-5-21-829997826-372528177-1256645902-500

S-1-5-21-337916495-1329879564-1005799528-512

S-1-5-21-337916495-1329879564-1005799528-118262

S-1-5-21-337916495-1329879564-1005799528-118263

S-1-5-21-337916495-1329879564-1005799528-118943

S-1-5-21-337916495-1329879564-1005799528-118335

S-1-5-21-829997826-372528177-1256645902-131074

S-1-5-21-829997826-372528177-1256645902-131077

S-1-5-21-194394294-102398579-185099702-40066

S-1-5-21-829997826-372528177-1256645902-131075

S-1-5-21-829997826-372528177-1256645902-131081

Re: how to - list groups for domainuser

a. I'm after a powershell command

b. I want to input the domainuser (whitehouse\obama) and get an output similar to this:

user whitehouse\obama is a member of the following groups:

backup operators

snapdrive_users

thanks anyway

Re: how to - list groups for domainuser

Hi Joel,

     It's me again!  Are you looking for the equivalent of a "wcc -s" command?  Or are you looking for an output of all the groups local to the filer?

I don't think there is any built in command with the wcc functions, but I also have not installed the 2.3 toolkit yet.  I do know that using the 2.3 toolkit you can use invoke-nassh -command COMMAND to run any particular command that there is no cmdlet for.

-Scott

Re: how to - list groups for domainuser

Scott

I thought it's impossible but wasn't sure

I'm familiar with invoke-nassh

thanks you for being my private mentor ;-)

Joel

Re: how to - list groups for domainuser

Try this:

Get-NaGroup | ? { Get-NaDomainUser -Group $_ | ? { $_.Name -imatch "myusername" } }