Discussion Locked

net localgroup won't add domain group to local Administrators group

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to use the net localgroup command to add an AD group to the local Administrators group on several machines. (I'm creating a .BAT file that can be run easily rather than having to manually add it.) It seems to work with some groups but not others.

For example,
net localgroup "Administrators" "mydomain\Group1" /ADD
works fine, but
net localgroup "Administrators" "mydomain\Group2" /ADD
comes back with the help text about proper syntax and the group is not added.

The only difference between the 2 commands is the name of the group. Are there limitations with the net localgroup command on anything like number of characters in the name of the item to add (the "mydomain\Groupx" part), or any illegal characters in group names (some of the group names have a dash in them), or can it only add Domain Local groups and not Global or Universal groups to a PC's local groups, or are specific rights required to the group object in AD that we want to add where we may have those rights to some groups but not others? (I am logged into the PC as an ID with Administrator rights on the local PC when trying to run the net localgroup command.)

Thank you!

10 replies

by chug

I wanted to include some additional information.

I CAN add these groups manually through Local Users and Groups in the local PC Computer Management screen. When I add a domain group manually to the Administrators group that I can't add with the net localgroup command, I have the same problem using net localgroup /delete to try to remove the domain group from the local group. I can manually remove the domain group from the local group though.

Again, this only happens with some domain groups. Some domain groups add and remove using net localgroup just fine, but any I can't add with net localgroup I also can't delete using net localgroup if I add the domain group manually.

Hopefully that all makes sense.

Thanks again!

by cg it

hummm local security groups are those specific to the machine. domain local groups are specific to the domain in which the computer belongs to. Universal groups only work in a Native mode active directory environment. Global groups are used to collect users in a security group for the purposes of giving permission to access to objects [ resources such as printers].

What I don't understand is why your trying to add an Active Directory security group to a local machine security group. Security policies are applied local, site, domain OU in that order. If a user logs on locally, only the local machine security policy is applied and only to users who have local machine accounts. An Active Directory security group does not have any rights locally as their accounts [SID] are stored in Active Directory on the domain controllers and not on the local machine.

by chug

In response to the first answer, it grants certain Domain users Administrator rights to the local PC. It's for a help desk where each help desk member's Domain user ID is a member of an Active Directory group that defines what help desk they're on. That group is then added to the Administrators group on the local PC so people on the help desk have full control of the PC. There's a different group for different help desks and those different groups are added to the Administrators local group on different PC's. I'm not questioning that. This all works as intended if we add the Domain groups to the local Administrators group manually. The only question is why the "net localgroup" command fails with some of the groups but not other groups (we want to put it in a .BAT file to make it easier to add to each machine). As far as the domain groups we're trying to add to the local Administrators group, I have verified that they are all Domain Local Security groups. The only difference between groups that work and groups that don't appears to be the length of the name of the group though I can not find any information anywhere that indicates that the "net localgroup" has a limitation in the number of characters it can handle in group names. If there is such a limitation, anybody know of a way around it.

by d_dickinson

I'm getting the same problem, and it seems to be a limit on the number of letters on the account. I've tried:-

XXX\xxx-xxxxx_xxxxxxxx_x

and it came back saying that the account didn't exist (which it doesn't), but if I use

XXX\xxx-xxxxx_xxxxxxxx_xx

I get the message about syntax. I know it's not much help, but the limit seems to be 20 + 3 for the domain (XXX). If anyone can find a way round this, please let us know!!!!

by ak6110

I find that the KB article is not very accurate, I have a domain/globalgroup which is 30 chrs long and still I am able to use the Net command to add into the local admin group, but in the other hand I cannot will have syntac error when trying to add 33 chrs long name.

by mrhappysbluegrass

I'm trying to add domain admins group from a trusted domain to the local admin group on the local machine.

net localgroup administrators domain/administrators /add but it won't work.

net localgroup administrators domain/my-nt-id /add DOES work.

WHY?
It's driving me nutso!!!!!

by jamiefurr

MS has answered this for u sin the following KB article...

http://support.microsoft.com/kb/324639

Excerpt from KB ~

CAUSE
The NET.EXE command does not support names longer than 20 characters for reasons of backward compatibility with LAN Manager 2.0.

For additional information about this LAN Manager 2.0 limitation, click the following article number to view the article in the Microsoft Knowledge Base:
131417 Windows NT global groups are limited to 20 character names
Back to the top
RESOLUTION
If the graphical user interface (GUI) method cannot be used and a scripting method is required, use the Windows 2000 Resource Kit utility Cusrmgr.exe. Or, use VBScript, using an application programming interface (API) that supports names longer than 20 characters.

This discussion is closed to new replies.