I'm familiar with using the NET commands to get information for local users and groups in most scenarios. However, I'm running into a problem using it to get information for domain groups with long names. The output of NET USER appears to cap group names at around 20 characters, and I haven't found a way to use NET GROUP to get information about any groups that have names longer than that.
Certainly, from my own workstation I can use Remote Server Administration Tools utilities (e.g.: "ds..." commands, or the Active Directory module in PowerShell) to get the information I need. However, I also want to be able to look up domain group details from other systems which might not have RSAT and on which I may not be able/allowed to install additional tools.
While solving the problem with the NET GROUP command would be interesting, I'm not necessarily limited to that tool. However, I do need to limit myself to only the tools available in a core installation of the Windows 7 (or similar) operating systems so that I can easily port the solution across different computers where adding other tools might not be an option. If there's a way to do this with something like WMIC, or PowerShell without the additional RSAT modules, I'm definitely interested in hearing about it.
Example: "MyReallyLongDomainGroupName" is a member of the local Admins group. So, who has admin access to the system? Or "AnotherVerboseDomainGroupName" is in some file share permissions - who has access to that share?
The old
NET
command still has limitations from the Windows NT era that it was created in. To handle longer names you're better off using the variousds...
commandsdsquery
,dsmod
, etc, or third-party tools likeadfind
. You won't have name length limitations there.Edit:
The
ds
tools are standalone EXEs that, while present in RSAT, can be freely copied around. Even so, because I want to honor the spirit of your request, here's a Powershell script that relies on the ADSI interface (present in Windows w/o requiring RSAT to be installed-- it's a base OS component) that will enumerate the membership of a group.I tested this with a limited user account on a Windows 7 x64 SP1 machine w/ no RSAT installed. I tested with a group named "123456789012345678901234567890123456789012345678901234567890", as well.
There's absolutely no error checking in this script.
Adding another answer, since my current answer is based on the currently logged on user's groups...and the OP stated in a comment:
So here you go...I tested this from a regular user's account on a Win7 workstation:
From the RUN line (win+R)
Rundll32 dsquery.dll OpenQueryWindow
That should pop up an AD query window where you can then find the group in question...double click the group...and see the users in the group.
You could use Powershell.
The first just print a bunch of details on the groups. The second prints only their names.
EDIT: If ActiveDirectory module is available only through RSAT, then here's a .net solution.
OK, so knowing you want NON-RSAT tools from a domain computer that isn't your workstation, then I'll make an assumption that you are wanting to figure out the groups that the user on that workstation is a member of.
IF that's the case there's a few options I can think of:
WHOAMI /GROUPS
mstsc
and rdp into your workstation or a DC and use normal toolsgpresult /R /SCOPE USER
All of these of course require that you are on the domain with the computer able to query a DC.
Hope that helps...best I can think of at the moment.