Exchange 2010 schema information

Posted on 2011-03-17
Last Modified: 2012-06-27
Hi Experts.

Using Powershell or c# I want to be able to get type information for Exchange attributes.
For example I would like to get a list of properties that are available on a mailbox and the type of that property before I actually get information for a particular mailbox.

Can anyone tell me how to do that?

Question by:Hagley
  • 2
LVL 13

Accepted Solution

soostibi earned 500 total points
ID: 35155463
This is not an easy question. Unfortunately there is no such object in AD as Mailbox. Normal user accounts have Exchange attributes, that relate to mailbox information. Some of these attributes are already in the schema, some come when we extend the schema for Exchange.
Some mailbox related attributes have a name starting with 'msExch-', some don't. So, to filter only Exchange related attributes is not an easy thing.

Here is a code that selects all the attributes starting with "msExch" only. To run this, you have to have ActiveDirectory module imported.
$syntaxhash = @{
'' =	'Boolean'
'' =	'Integer'
'' =	'String(Octet)'
'' =	'String(Sid)'
'' =	'String(Object-Identifier)'
'' =	'Enumeration'
'' =	'String(Numeric)'
'' =	'String(Printable)'
'' =	'CaseIgnoreString(Teletex)'
'' =	'String(IA5)'
'' =	'String(UTC-Time)'
'' =	'String(Generalized-Time)'
'' =	'Case-Sensitive String'
'' =	'String(Unicode)'
'' =	'LargeInteger'
'' =	'String(NT-Sec-Desc)'
'' =	'Object(DN-DN)'
'' =	'Object(DN-Binary)'
'' =	'Object(Presentation-Address)'
'' =	'Object(DN-String)'
'' =	'Undefined'

filter get-systemAuxiliaryClass 
    $ado = Get-ADObject -Properties maycontain, systemmaycontain, systemAuxiliaryClass -Filter {objectClass -eq 'ClassSchema' -and lDAPDisplayName -eq $_} `
        -SearchBase ((Get-ADForest).partitionscontainer -replace "partitions","schema")
        $ado.systemAuxiliaryClass | get-systemAuxiliaryClass

"user" | get-systemAuxiliaryClass | %{
    $_.maycontain, $_.systemmaycontain 
} | %{$_} | ?{$_ -like "msExch*"} | %{
    Get-ADObject -Properties * -Filter {objectClass -eq 'attributeSchema' -and lDAPDisplayName -eq $_} -SearchBase ((Get-ADForest).partitionscontainer -replace "partitions","schema")
} | ft name, @{n="syntax";e={$syntaxhash.($_.attributesyntax +"-"+$_.oMSyntax)}}, ismemberofpartialattributeset, issinglevalued -AutoSize

Open in new window

LVL 13

Expert Comment

ID: 35155472
Of course, this is a PowerShell code.
LVL 70

Expert Comment

by:Chris Dent
ID: 35687983
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
This article explains how to install and use the NTBackup utility that comes with Windows Server.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question