Answered by:
Retrieve custom attribute values using Exchange Management Shell

Question
-
I need to be able to retrieve a custom attribute values for a given mailbox. I can run Get-Mailbox -Identity "Mailbox_Name" | Format-List CustomAttribute5 to retrieve custom attributes but that retrieves the attribute in a formatted list and I just want the attribute value returned. I assume there must be a way to do this with the get-Mailbox cmdlet but I haven't found a way so far. Any ideas?
Thanks in advance!
Matthew
Friday, June 29, 2012 8:15 PM
Answers
-
If you only want the attribute returned, with no other formatting to the screen, try this:
(get-mailbox jsmith).customattribute5
Mike Crowley | MVP
My Blog -- Planet Technologies- Marked as answer by mdhtbm Monday, July 9, 2012 7:59 PM
Tuesday, July 3, 2012 2:49 PM
All replies
-
hi,
here is the technet article that describes the custom attributes in Exchange 2010
http://technet.microsoft.com/en-us/library/ee423541.aspx
The Active Directory attributes are called:
- ms-Exch-Extension-Attribute-16 to 45
- ms-exch-extension-custom-attribute-1 to 5
Hope this helps.
kind regards
Thomas
regards Thomas Paetzold visit my blog on: http://sus42.wordpress.com
- Proposed as answer by Xiu Zhang Monday, July 2, 2012 9:04 AM
Friday, June 29, 2012 10:32 PM -
Hi Matthew,
See if this gives you what you are looking for:
Get-mailbox "Mailbox User" | ForEach-Object {$_.customattribute5}
Martina Miskovic
- Edited by Martina_Miskovic Saturday, June 30, 2012 6:20 PM
- Proposed as answer by Xiu Zhang Monday, July 2, 2012 9:04 AM
Saturday, June 30, 2012 6:20 PM -
if you want a specific attribute rather than all then we can modify you PS command slightly.
Get-Mailbox -Identity "Mailbox_Name" | select CustomAttribute5
That will purely give back that attribute without anything else.
Oliver
Oliver Moazzezi | Exchange MVP, MCSA:M, MCITP:Exchange 2010, BA (Hons) Anim | http://www.exchange2010.com | http://www.cobweb.com | http://twitter.com/OliverMoazzezi
Sunday, July 1, 2012 12:22 AM -
Hi,
any updates? If your question is answered it would be nice if you mark it accordingly because this may help others who have got the same or a similar question.
regards Thomas Paetzold visit my blog on: http://sus42.wordpress.com
Monday, July 2, 2012 7:18 PM -
If you only want the attribute returned, with no other formatting to the screen, try this:
(get-mailbox jsmith).customattribute5
Mike Crowley | MVP
My Blog -- Planet Technologies- Marked as answer by mdhtbm Monday, July 9, 2012 7:59 PM
Tuesday, July 3, 2012 2:49 PM -
Thanks Mike!
That is exactly what I was looking for. I knew there was a way to retrieve a single unformated attribute from get-mailbox, but didn't know the correct syntax to retrieve it.
Matthew
Monday, July 9, 2012 8:01 PM -
FWIW, Martina's approach produces a similiar output.
Mike Crowley | MVP
My Blog -- Planet TechnologiesMonday, July 9, 2012 9:34 PM