Microsoft Virtualization Discussions

how to - list groups for domainuser

JSHACHER11
5,096 Views

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

1 ACCEPTED SOLUTION

cscott
5,096 Views

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

View solution in original post

5 REPLIES 5

bondbhola
5,096 Views

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

JSHACHER11
5,096 Views

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

cscott
5,097 Views

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

JSHACHER11
5,096 Views

Scott

I thought it's impossible but wasn't sure

I'm familiar with invoke-nassh

thanks you for being my private mentor 😉

Joel

bsti
5,096 Views

Try this:

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

Public