Count attributes or schema

  • 183 Views
  • Last Post 05 January 2019
manasrrp6 posted this 04 January 2019

Hi, How can I count total number of attributes or schema by either DOS or Power Shell command line.Very important for me. Regardscid:image002.gif@01D14ECD.C6D1DE80 

Order By: Standard | Newest | Votes
daemonr00t posted this 04 January 2019











AdFind has the -C switch that counts whatever the outcome is






Happy New Year to you all!










~dannyCS







show

bshwjt posted this 04 January 2019

Hi,
Which attribute? User or computers.
Thanks
On Fri, 4 Jan 2019 at 6:29 PM, Manas Dash <manasrrp6@xxxxxxxxxxxxxxxx> wrote:
Hi, How can I count total number of attributes or schema by either DOS or Power Shell command line.Very important for me. Regardscid:image002.gif@01D14ECD.C6D1DE80 

manasrrp6 posted this 04 January 2019

 Hi,Obviously user’s related attributes. Because I want to count the difference between previous number of attributes when there only AD, and after installing Exchange Server, how much it extended. Regardscid:image002.gif@01D14ECD.C6D1DE80 

show

daemonr00t posted this 04 January 2019

Hi again,

 

I might be losing part of this thread but think there’s nothing obvious on such vague question you’re throwing…

 

Anyway you might want to filter attributes by those that start with ms-Exch*



 

That would give you the majority of attributes.

 

Hope that helps,

 

 

~danny


Sent from Mail for Windows 10

 






show

michael1 posted this 04 January 2019

It’s easier (and more precise) to look at the ldif files included with the Exchange installer.

 

show

barkills posted this 04 January 2019

I’ll agree that the original question was vague. Schema is not just attributes. It’s also not just classes and attributes, although it is perfectly understandable that folks who only work with Microsoft directories might have been led to

believe that.

 

There seems to be a much more detailed question below the surface, which I feel we aren’t getting upfront, but instead must painfully pull out bit by bit.



 

Which Exchange schema version? Which AD schema version? What specific question are you trying to answer? Because without those two details, the number of

possible user attributes is going to vary.

 

I’ve italicized possible, because it’s yet another detail which may change the answer you are seeking. I presume you want the total number of possible user attributes, not the total number of mandatory user attributes or the total number

of system-maintained optional attributes, or the total number of non-system-maintained optional attributes, or … well, let’s stop there because I think my point has been made, but this list could be much longer. For example, how do I count an attribute which

is both in the default AD schema AND in the Exchange schema?

 

If it helps answer the question (or if the question isn’t really about being exact, but just close enough), I used to do analysis of the AD schema user attributes.

https://itconnect.uw.edu/wp-content/uploads/2016/05/userClass.xlsx has a spreadsheet that breaks down all the user attributes circa 2010 (I think), with differentiation by property

sets between Exchange 2007 and post Exchange 2007 schema. If something that old is good enough, it’d be a simple matter to sort the spreadsheet by the relevant columns and get your count.



 

If that’s not sufficient and you need something exact, I’d also note that Danny’s suggested approach won’t get you want you want. You’ll need to download all the relevant LDF files and analyze them. That might involve parsing them (PowerShell

+ RegEx would be an automated way to do that, but you’ll need to know the difference between mayContain, systemMayContain, and other schema language details) or loading them into AD-LDS and using the comparison tools it provides. When I used to keep that spreadsheet

up to date, I manually parsed the LDF files (yeah, I really like schema). If you need links to most of the LDF files,

https://itconnect.uw.edu/wares/msinf/design/schema/ has links for almost every schema we’ve added to our AD. I’ll note that in many cases, there is no Microsoft link for the LDF files, and so

I’ve compiled them from the media. Where there is no link, I didn’t do the work of compiling them (so you’ll have to do that step).

 

Brian

 

show

michael1 posted this 04 January 2019

There was nothing “obvious” in this request.

 

Also be aware that quite a number of Exchange schema extensions are also used by other products (Skype for Business is the first that comes to mind) and therefore

are not unique to Exchange.

 

show

manasrrp6 posted this 05 January 2019

Get-ADObject -SearchBase (Get-ADRootDSE).SchemaNamingContext -Filter {name -like "User"} -Properties MayContain,SystemMayContain | Select-Object @{n="Attributes";e={$.maycontain + $.systemmaycontain}} | Select-Object -ExpandProperty Attributes | Sort-Object Can this will work ? Regardscid:image002.gif@01D14ECD.C6D1DE80 

show

bshwjt posted this 05 January 2019

You don't need to compare the user attribute after the Exchange schema extension. Exchange attributes are documented on MS Portal.However you can check the user attributes using Powershell from Active Directory Schema ; have a look the below link.
https://blogs.technet.microsoft.com/poshchap/2017/09/22/one-liner-query-the-ad-schema-for-user-object-attributes/
Thanks & RegardsBiswajit Biswas a.k.a bshwjtInfrastructure Engineer – Active Directory, Microsoft PKI, ADFSWindows PowerShellMSDN Script Gallery | Microsoft Community Contributor
    
On Fri, 4 Jan 2019 at 23:10, Manas Dash <manasrrp6@xxxxxxxxxxxxxxxx> wrote:

show

Close