导出用户类的所有AD属性和默认的“范围上限”大小?

我需要在用户属性中写入大约1000-5000个字符,但是我不想编辑模式的rangeUpper属性,或者只是为了我的目的创build一个。

我应该如何研究哪些用户属性可以重新调整呢? 换句话说,如何将AD用户可用的所有属性以及相应的rangeUpper值导出?

下面的PowerShell将查看模式的用户类 ,获取它的allowedAttributes属性,然后查找每个属性的定义并返回其rangeUpper值。

 # Need the Microsoft AD PS module Import-Module ActiveDirectory # Get the user class definition, include "allowedAttributes" $userClass = Get-ADObject -SearchBase ((Get-ADRootDSE).schemaNamingContext) -Filter { Name -eq "User" } -Properties allowedAttributes # Walk the allowedAttributes array and sort into a table with "name" and "rangeUpper" $userClass.allowedAttributes | ForEach-Object { Get-ADObject -SearchBase ((Get-ADRootDSE).schemaNamingContext) -Filter { LDAPDisplayName -eq $_ } -Property rangeUpper } | Sort-Object Name | Format-Table -Property Name, rangeUpper # If you want to only see defined "rangeUpper" values $userClass.allowedAttributes | ForEach-Object { Get-ADObject -SearchBase ((Get-ADRootDSE).schemaNamingContext) -Filter { LDAPDisplayName -eq $_ } -Property rangeUpper } | Where-Object { $_.rangeUpper } | Sort-Object Name | Format-Table -Property Name, rangeUpper