NET.EXE/ADD 指令並不支援超過 20 個字元的名稱

文章編號: 324639 - 檢視此文章適用的產品。
全部展開 | 全部摺疊

徵狀

當您使用 NET.EXE 命令時 / 加入 參數和長的使用者或群組名稱時,這只會重新顯示 NET 語法。您會收到任何錯誤訊息。

範例
C:\>NET.EXE localgroup MyRemoteUsers "REMOTE INTERACTIVE LOGON" /ADD

The syntax of this command is:

NET LOCALGROUP [groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE}  [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]
					
在同一個動作 不會 使用 GUI 電腦管理、 本機使用者及群組 Microsoft 管理主控台 (MMC)。

發生的原因

NET.EXE 命令並不支援超過 20 個字元的名稱與 LAN 管理員 2.0 的回溯相容性的原因。

取得更多資訊有關這個 LAN 管理員 2.0 限制按一下 [下面的文件編號,檢視 「 Microsoft 知識庫 」 中的發行項]:
131417Windows NT 通用群組受限於 20 字元名稱

解決方案

如果無法使用圖形化使用者介面 (GUI) 方法,而且指令碼的方法是必要,使用 Windows 2000 資源工具箱 」 公用程式 Cusrmgr.exe。或使用使用的應用程式發展介面 (API) 支援名稱超過 20 個字元的 VBScript。

狀況說明

Microsoft 已確認<適用於>一節所列之 Microsoft 產品確實有此問題。

其他相關資訊

在本文的 < 徵狀 > 一節中範例,請使用下列的 Cusrmgr.exe 語法:

C:\>CUSRMGR.EXE -u "REMOTE INTERACTIVE LOGON" -alg "MyRemoteUsers"
				
這個問題也可能發生的內建群組超過 20 字元的名稱限制--,例如德文已驗證使用者名稱的當地語系化版本 (19 個字元):"Authentifizierte Benutzer 」 (25 個字元)。

下列範例 VBScript 可能適應,並做為額外的因應措施。它為英文和德文版新增至 「 進階使用者 」 已驗證使用者:
##### VBScript ADDGRP.VBS #####
 
On Error Resume Next 
 
Dim oContainer 
Dim oGroup 
Dim oIADs 

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

屬性

文章編號: 324639 - 上次校閱: 2009年3月2日 - 版次: 6.0
這篇文章中的資訊適用於:
  • Microsoft Windows Server 2003 R2 Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003 R2 Enterprise Edition (32-Bit x86)
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows XP Home Edition (家用版)
  • Microsoft Windows XP Professional
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows NT Server 4.0, Terminal Server Edition
關鍵字:?
kbmt kbprb KB324639 KbMtzh
機器翻譯
重要:本文是以 Microsoft 機器翻譯軟體翻譯而成,而非使用人工翻譯而成。Microsoft 同時提供使用者人工翻譯及機器翻譯兩個版本的文章,讓使用者可以依其使用語言使用知識庫中的所有文章。但是,機器翻譯的文章可能不盡完美。這些文章中也可能出現拼字、語意或文法上的錯誤,就像外國人在使用本國語言時可能發生的錯誤。Microsoft 不為內容的翻譯錯誤或客戶對該內容的使用所產生的任何錯誤或損害負責。Microsoft也同時將不斷地就機器翻譯軟體進行更新。
按一下這裡查看此文章的英文版本:324639
Microsoft及(或)其供應商不就任何在本伺服器上發表的文字資料及其相關圖表資訊的恰當性作任何承諾。所有文字資料及其相關圖表均以「現狀」供應,不負任何擔保責任。Microsoft及(或)其供應商謹此聲明,不負任何對與此資訊有關之擔保責任,包括關於適售性、適用於某一特定用途、權利或不侵權的明示或默示擔保責任。Microsoft及(或)其供應商無論如何不對因或與使用本伺服器上資訊或與資訊的實行有關而引起的契約、過失或其他侵權行為之訴訟中的特別的、間接的、衍生性的損害或任何因使用而喪失所導致的之損害、資料或利潤負任何責任。

提供意見