Windows Server 2008/R2: ユーザー名の最大長を変更しますか?

Windows Server 2008/R2: ユーザー名の最大長を変更しますか?

ローカル アカウントの標準 20 文字のユーザー名の最大長制限を変更する方法はありますか?

(具体的には Server 2008 R2)

答え1

いいえ、20 に固定されています。これは下位互換性のためだと思います。Active Directory ではさらに大きな値を設定できますが (SAMAccountName フィールドを除く)、ローカルでは設定できません。

答え2

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 を超える文字の名前を作成するには、プログラムで作成する必要があります。

答え3

「GUI では 20 文字の名前しか作成できないことに注意してください。20 を超える文字の名前を作成するには、プログラムで作成する必要があります。」

その記述は間違っていると思います。20 文字を超えるユーザー名をプログラムで作成することはできません。以下は、Windows Server 2008 R2 で実行した関連する VB.NET コードです。20 文字以下のユーザー名の作成には機能しますが、ユーザー名が 20 文字を超えると例外が発生します。自分で試してみてください。敬具、Joseph Davoli

コード:

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

答え4

W2K3 AD サーバーに DSADD を使用していますが、「SAMID」の長さが 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]
└─────────────────────────────────────┘

改善のためのコメントは大歓迎です。

関連情報