Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get user's non-truncated Active Directory groups from command line

I often use the net user command to have a look at AD groups for a user:

net user /DOMAIN <username> 

This works well, however the group names are truncated to around 20 characters. And in my organization, most group names are much longer than this.

Does anyone know of a way to get non-truncated AD groups through the command line?

like image 414
Ben Avatar asked Sep 22 '09 03:09

Ben


People also ask

How do you check what groups a user is in Windows?

In the properties window for the user account, switch to the “Member Of” tab. This tab shows you the local groups to which the user account belongs, and also lets you add the account to other groups.

How do I get a list of members of ad group in PowerShell?

Use Get-ADGroupMember cmdlet to List Members of an Active Directory Group. The PowerShell Get-ADGroupMember cmdlet is used to list the members of an Active Directory group. You can just type the cmdlet in a PowerShell window and you'll be prompted to enter the name of the group you want to use.


1 Answers

GPRESULT is the right command, but it cannot be run without parameters. /v or verbose option is difficult to manage without also outputting to a text file. E.G. I recommend using

gpresult /user myAccount /v > C:\dev\me.txt--Ensure C:\Dev\me.txt exists

Another option is to display summary information only which may be entirely visible in the command window:

gpresult /user myAccount /r

The accounts are listed under the heading:

The user is a part of the following security groups --------------------------------------------------- 
like image 150
P.Brian.Mackey Avatar answered Oct 01 '22 02:10

P.Brian.Mackey