Microsoft KB Archive/324639

= NET.EXE /ADD command does not support names longer than 20 characters =

Article ID: 324639

Article Last Modified on 3/1/2007

-

APPLIES TO


 * Microsoft Windows NT Server 4.0, Terminal Server Edition
 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows XP Home Edition
 * Microsoft Windows XP Professional
 * Microsoft Windows NT Workstation 4.0 Developer Edition

-



This article was previously published under Q324639



SYMPTOMS
When you use the NET.EXE command with the /ADD switch and long user or group names, this only redisplays the NET syntax. You receive no error message.

Example:

C:\>NET.EXE localgroup MyRemoteUsers &quot;REMOTE INTERACTIVE LOGON&quot; /ADD

The syntax of this command is:

NET LOCALGROUP [groupname [/COMMENT:&quot;text&quot;]] [/DOMAIN] groupname {/ADD [/COMMENT:&quot;text&quot;] | /DELETE} [/DOMAIN] groupname name [...] {/ADD | /DELETE} [/DOMAIN]

The same action does work with the GUI Computer Management, Local Users and Groups Microsoft Management Console (MMC).



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



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.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
In the example in the &quot;Symptoms&quot; section of this article, use the following Cusrmgr.exe syntax:

C:\>CUSRMGR.EXE -u &quot;REMOTE INTERACTIVE LOGON&quot; -alg &quot;MyRemoteUsers&quot; This issue may also occur with localized versions in which built-in groups exceed the 20 character name limit -- for example, with the German name for &quot;Authenticated Users&quot; (19 characters): &quot;Authentifizierte Benutzer&quot; (25 characters).

The following sample VBScript may be adapted and used as an additional workaround. It adds &quot;Authenticated Users&quot; to &quot;Power Users&quot; for the English and German version: On Error Resume Next Dim oContainer Dim oGroup Dim oIADs
 * 1) VBScript ADDGRP.VBS #####

Dim oComputerInformation Dim bolGroupSet bolGroupSet = False Set oComputerInformation = CreateObject(&quot;WScript.Network&quot;) Set oContainer = GetObject(&quot;WinNT://&quot; + oComputerInformation.ComputerName) 'get the IADsContainer object for the local computer oContainer.Filter = Array(&quot;Group&quot;) 'We only need to enumerate groups, therefore the filter For Each oIADs In oContainer 'for each IADs object we find there If oIADs.Name = &quot;Hauptbenutzer&quot; Or oIADs.Name = &quot;Power Users&quot; Then 'check if it has the name &quot;Power Users&quot; or &quot;Hauptbenutzer&quot; Set oGroup = oIADs 'If so put it into the IADsGroup object oGroup.Add (&quot;WinNT://S-1-5-11&quot;) 'add the group &quot;Authenticated Users&quot; oGroup.SetInfo 'and save the info If Err <> 0 Then 'if error number is not 0 (Error occurred) MsgBox Err.Number, vbCritical, &quot;AddGroup&quot; 'print out the error message Else 'if everything seems to be ok bolGroupSet = True 'set the boolean value to True so we know the group was added End If End If Next If bolGroupSet = True Then 'if bolGroupSet is False there was nothing done MsgBox &quot;Group added successfully&quot;, vbInformation, &quot;AddGroup&quot; Else MsgBox &quot;No action has taken place!&quot;, vbExclamation, &quot;AddGroup&quot; End If
 * 1) script end #####

Additional query words: NET.EXE limit

Keywords: kbprb KB324639

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.