AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 105142
Accepted
Matias Nino
Matias Nino
Asked: 2010-01-22 11:11:41 +0800 CST2010-01-22 11:11:41 +0800 CST 2010-01-22 11:11:41 +0800 CST

Windows Server 2008/R2:更改最大用户名长度?

  • 772

有没有办法更改本地帐户的标准 20 个字符的用户名最大长度限制?

(具体是Server 2008 R2)

windows windows-server-2008 user-management
  • 4 4 个回答
  • 43448 Views

4 个回答

  • Voted
  1. Best Answer
    squillman
    2010-01-22T11:17:27+08:002010-01-22T11:17:27+08:00

    不,它固定在 20。我相信这是出于向后兼容性的原因。您可以在 Active Directory 中变大(SAMAccountName 字段除外),但不能在本地变大。

    • 11
  2. Jim B
    2010-01-22T12:00:33+08:002010-01-22T12:00:33+08:00

    您必须引用 sam-accountname 属性。登录名必须遵循以下规则:

    登录名规则

    登录名必须遵循以下规则:

    本地登录名在工作站上必须是唯一的,而全局登录名在整个域中必须是唯一的。

    登录名最多可包含 104 个字符。但是,使用长度超过 64 个字符的登录名是不切实际的。

    为所有帐户提供 Microsoft Windows NT 4.0 或更早版本的登录名,默认设置为 Windows 2000 登录名的前 20 个字符。Windows NT 4.0 或更早版本的登录名在整个域中必须是唯一的。

    从 Windows 2000 计算机登录到域的用户可以使用其 Windows 2000 登录名或 Windows NT 4.0 或更早版本的登录名,而不管域操作模式如何。

    请注意,GUI 只允许您创建 20 个字符名称,您必须以编程方式创建它们才能超过 20 个。

    • 9
  3. Joseph Davoli
    2011-04-15T08:59:47+08:002011-04-15T08:59:47+08:00

    “请注意,GUI 只允许您创建 20 个字符名称,您必须以编程方式创建它们才能超过 20 个。”

    我会说这种说法是不正确的。我无法以编程方式创建超过 20 个字符的用户名。下面是我在 Windows Server 2008 R2 上运行的相关 VB.NET 代码。它适用于创建二十个或更少字符的用户名,但如果用户名超过二十个字符,则会引发异常。自己试试。此致,约瑟夫·达沃利

    代码:

    Imports System.DirectoryServices    'Gives us access to Directory Services.

    Function Blah() As Whatever

    Dim strFNMILN As String = "Christopher.B.Robinson" 'NOTE: Twenty-two characters. Dim strFullName as string = "Christopher B. Robinson"

    'Declare a new "DirectoryEntry" object variable and assign to it the entry for 'this computer (the computer on which this code is running). Dim DirectoryEntryThisComputer As New DirectoryEntry("WinNT://" & Environment.MachineName & ",computer")

    'Declare a new "DirectoryEntry" object variable and name it "DirectoryEntryNewUser". 'Create a new user in the local directory and assign that user to our object variable. Dim DirectoryEntryNewUser As DirectoryEntry = DirectoryEntryThisComputer.Children.Add(strFNMILN, "user")

    'Add the fullname of this user. DirectoryEntryNewUser.Invoke("Put", New Object() {"fullname", strFullName })

    'Add a description value. DirectoryEntryNewUser.Invoke("Put", New Object() {"description", "This is a test user."})

    'Set the password for this new user (14 character minimum). DirectoryEntryNewUser.Invoke("SetPassword", New Object() {"abcdefg1234567"})

    'Save this new user to the local directory (this machine's directory). DirectoryEntryNewUser.CommitChanges()

    . . End Function

    • 5
  4. Rhak Kahr
    2013-07-02T23:58:31+08:002013-07-02T23:58:31+08:00

    我在 W2K3 AD 服务器中使用 DSADD,由于“SAMID”的 21(21)个字符长度而失败。

    C:\Users\admin-of-change>DSAdd.exe user "CN=SharePoint Service Applications XYZ,OU=Users,OU=District UVW,OU=XYZ,DC=domain-universe,DC=int,DC=net" -samid "adm_xyz_SPServiceApps" -upn [email protected] -fn "SharePoint Service Applications" -ln "XYZ" -display "SharePoint Service Applications XYZ" -pwd "continue2013" -desc "Non Human Account" -office "Head Office" -email [email protected] -webpg "www.UnusualCompany.com" -title "SharePoint Service Applications XYZ" -company "X Y Z" -disabled no
    dsadd failed:CN=SharePoint Service Applications XYZ,OU=Users,OU=District UVW,OU=XYZ,DC=domain-universe,DC=int,DC=net:The name provided is not a properly formed account name.
    type dsadd /? for help.
    
    ┌─────────────────────────────────────┐
    │ Executed Tue 07/02/2013 13:59:57.88 │ As [admin-of-change]
    └─────────────────────────────────────┘
    

    减少UPN的同时解决了。

    C:\Users\admin-of-change>DSAdd.exe user "CN=SharePoint Service Applications XYZ,OU=Users,OU=District UVW,OU=XYZ,DC=domain-universe,DC=int,DC=net" -samid "adm_xyz_SPSvcApps" -upn [email protected] -fn "SharePoint Service Applications" -ln "XYZ" -display "SharePoint Service Applications XYZ" -pwd "continue2013" -desc "Non Human Account" -office "Head Office" -email [email protected] -webpg "www.UnusualCompany.com" -title "SharePoint Service Applications XYZ" -company "X Y Z" -disabled no
    dsadd succeeded:CN=SharePoint Service Applications XYZ,OU=Users,OU=Users,OU=District UVW,OU=XYZ,DC=domain-universe,DC=int,DC=net
    
    ┌─────────────────────────────────────┐
    │ Executed Tue 07/02/2013 14:06:21.08 │ As [admin-of-change]
    └─────────────────────────────────────┘
    

    欢迎任何改进意见。

    • 0

相关问题

  • 您最喜欢的云计算提供商是什么?[关闭]

  • Vanilla Powershell 是否足以成为 Windows 和 DB 服务器管理员的语言?

  • 为什么添加新驱动器后我的磁盘驱动器访问速度如此之慢?

  • 在 Windows Server 2003 下使用 wscipt 从 .asp 文件运行 .exe

  • 最佳混合环境(OS X + Windows)备份?[关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    从 IP 地址解析主机名

    • 8 个回答
  • Marko Smith

    如何按大小对 du -h 输出进行排序

    • 30 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    MikeN 在 Nginx 中,如何在维护子域的同时将所有 http 请求重写为 https? 2009-09-22 06:04:43 +0800 CST
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    0x89 bash中的双方括号和单方括号有什么区别? 2009-08-10 13:11:51 +0800 CST
  • Martin Hope
    Kyle Brandt IPv4 子网如何工作? 2009-08-05 06:05:31 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve