Follow me on Twitter @AntonioMaio2

Thursday, October 20, 2016

Synchronizing Custom AD Attributes to Office 365 - Part 2

This blog is the 2nd in a 3 part series on synchronizing and working with custom AD attributes in Office 365. In this post we continue with showing you how to retrieve attributes in Office 365 using PowerShell.


PowerShell can be used to both verify that your custom attributes have actually been synchronized to Office 365, and it can be used to actually accomplish things with those attributes, like having them sync'ed to your user profile in SharePoint Online (but that's for another article).



Step 2 - Retrieve Attributes in Office 365 Using PowerShell

Once we have custom attributes synchronizing to Office 365 using AD Connect, we would naturally want to use to verify that the attributes have successfully sync'ed.  As well, we would naturally use PowerShell to do this. However, there are some important concepts that we first need to understand to do this.

1. To access user accounts in Azure AD within Office 365, we typically use the Windows Azure Active Directory Module for Windows PowerShell.

connect-msolservice (provide your global administrator credentials when prompted)
get-msoluser -userprincipalname <a user's UPN> | select *

  • This will return a pre-defined set of 59 attributes for the user, however it will NOT return all of the attributes associated with the user account.  For example, it will NOT return any of the extension attributes.  You can see a list of the attributes that are retrieved here: get-msoluser.

2. To retrieve additional attributes or the extension attributes associated with the user's Azure AD account, you must use the Exchange Online PowerShell module.
  • To use Exchange Online cmdlets for a user account, that user account MUST have an Exchange Online mailbox, which means they MUST be licensed for Exchange Online.  If a user is not licensed for Exchange Online, the sync process still synchronizes the attributes correctly for that user.  However, the limitation here is that you will not be able to call the Exchange Online cmdlets for that user - you can still call get-msoluser as described above to get that subset of attributes.
  • To connect to the Exchange Online PowerShell module, you can use the following:

$sUserName = Read-Host "Enter an administrator username" 
$sPassword = Read-Host "Enter an administrator password" -AsSecureString
$credential = New-Object System.Management.Automation.PsCredential($sUserName,$sPassword)

$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" –AllowRedirection

Import-PSSession $exchangeSession
  • In order to retrieve additional attributes about a user, and more specifically retrieve the extension attributes, you can call either get-mailbox or get-recipient as follows.  
get-mailbox <a user's email address> | select *

get-recipient <a user's email address> | select *

You can use either one of these cmdlets, and you can get more information about these here: get-mailbox and get-recipient.
  • With either of these cmdlets you'll notice that you get a lot more attributes returned.  In particular you get customAttribute1, customAttribute2 ...customAttribute15.  These map directly to the following attributes in your on premise AD environment: extensionAttribute1, extensionAttribute2 ...extensionAttribute15.  Their purpose is to provide some built in attributes with which clients can use custom attributes in on premise AD without editing the actual AD schema.
  • As you can see, the name of an attribute in Azure AD is often slightly different from the corresponding name of the attribute in on premise AD.

3. When testing retrieval of extension attributes for a user, ensure that you're calling the cmdlets for a user account that has actually values in those extension attributes in your on premise AD.  I know it sounds simple, but many times I've seen people say 'my attributes are not sync'ing' only to find out that the user they're testing didn't actually have values in those attributes in AD.

4. You'll notice that with any of the preceding PowerShell cmdlets shown, the custom AD attributes you've configured AD Connect to synchronize are not shown.  We can see the built-in extension attributes, but not any custom attributes.  
  • Unfortunately, there currently is no Office 365 workload that will consume or work with these attributes.  Not even the PowerShell cmdlets currently available will access or retrieve these custom attributes.
  • It is however possible to work with the Microsoft Graph API to retrieve these custom attribute values.  Microsoft has published a Quick Start Guide for the Graph API if you wish to use that.
  • The custom attribute from your on premise AD is actually published to Azure AD with a name that looks like the following:
extension_<application GUID>_<custom attribute name>


You can see the custom attribute name that is being synchronized to Office 365 for your custom attributes if you use the MIISCLIENT application (available at C:\Program Files\Microsoft Azure AD Sync\UIShell\miisclient.exe on the AD Connect server) to watch the synchronization process and review the actual updates made.  Remember, do not try to execute the sync or modify any sync settings through the MIISCLIENT application.  Only use the AD Connect configuration wizard for any sync configuration.

Part 3 in this series can be found here: Step 3 - Customize AD Connect Synchronization Rules.

33 comments:

  1. Synchronizing Custom AD Attributes to Office 365, such a great move by the Microsoft team and great inventions they are putting. I can't wait to install this latest version.

    ReplyDelete
  2. Your post give me lots of advise it is very useful for me. I want to introduce for you about the game- sims 4 cheats. in this game, you can create character and operate as sames as in the real world. Click link to participate games.

    ReplyDelete
  3. The prices shown in Bangalore escorts are only for time and sympathy, and not for any illegal acts. Any personal conduct of an intimate nature is a matter of agreement between two consenting adults and between closed doors or a similar personal method or place.
    Lovepreet Kaur
    Bangalore Escorts
    Bangalore Escort Service

    ReplyDelete
  4. this was first time seeing this contenting its realy impressive and greate blog.

    18+ escort girls
    desi call girls in bangalore
    hookers in bangalore

    ReplyDelete
  5. Bangalore escort services are largely here to give you an astonishing encounter. The most electrifying hours with intriguing Bangalore escorts are on your way.
    Bangalore Escorts
    Elite Escorts
    Call Girls
    Escorts Service
    Model Escorts
    High Profile Escort
    air-hostess-escorts

    ReplyDelete
  6. Thank you for knowing this topic of yours.
    Uttam nagar Escorts provide high-profile escorts services in Delhi.
    Uttam nagar Escorts

    ReplyDelete
  7. Delhi Escorts Offers Incall And Outcall Sexual Services To U
    If you want to have some unforgettable time. Delhi Escorts - your best reliable Escort service in Delhi. Only Delhi Escort girls have a sense of fashion and are conscious of the etiquette and popular conversation subjects. The escort in delhi comes with a lot of assortment of girls in delhi who can offer erotic massages in the hottest style.
    Delhi Escorts
    Call Girl in Delhi

    ReplyDelete
  8. we only cater to people of the upper class. Our cost is very affordable and please do not negotiate about the fees. because we offer premium call girls at affordable prices and you should appreciate that. The independent gurgaon escorts are really fun and inspirational to inspire you to do interesting and fun things rather than just live that old and boring life.
    Gurgaon escort service
    Gurgaon escorts
    Gurgaon Call girls
    Escorts in Gurgaon
    Gurgaon Female escorts
    Call girl service in Gurgaon
    Escort service in Gurgaon

    ReplyDelete
  9. If you've got a good place then we send your home sort of a hotel, home or guest houses if you've got not an area we'll provide you safe and secure neat and clean independent flat or five star hotels including madam available inside the rooms Delhi Call Girls Service.

    ReplyDelete
  10. Welcome to premier agency in Hyderabad, offering an outstanding range of Female Escorts in Hyderabad and erotic services. If you are interested in using our service, we are just a phone call away.
    Hyderabad Escorts

    High Profile Escorts in Abids

    Independent Escorts In Ameerpet

    Banjara Hills Escorts

    Begampet Escorts

    Gachgoli Escorts

    Hitech Escorts

    ReplyDelete

  11. Do you want to get a full exotic service? Mumbai Escorts Hub here at your service. You can meet with our call girls to make your time memorable full of enjoyment. We offer all types of sex with great satisfaction. Our Independent call Girl gives real massage along with full service of deep throat, cim, cum, anal and much more basically you think our ladies and would love to serve you without rushing. It's our passion and choice to be an escort that's why our call girls love to satisfy our clients for recommendation and referral.

    Mumbai Escorts Services:
    Mumbai Escorts | Mumbai Escorts Service |

    Mumbai Sex Aunty Number | Phone Sex Mumbai | Mumbai Call Girl Whatsapp Number | Mumbai Call Girls Near Me |

    ReplyDelete
  12. Welcome to the beautiful world of escorts in Delhi. Here you will get the most delicious and tempting Call Girls in Delhi who are awaited so much to being physical with you. Yes, it is true just meet our escorts in Delhi, they are waiting to provide extraordinary service to you. Russian Delhi Escorts is offering such beautiful and high-profile models available 24x7 hours for you. If you are here in Delhi and looking for vivacious escorts in Delhi then we are pretty perfect for you. Here you will get all the possibilities to find a hot girl and to make all your sexual dreams come true with her. This is the best chance for you to make every need filled with hot girls in this area. We know very well what you want from escorts in Aerocity and our call girls are very passionate about their work.

    ReplyDelete
  13. Hey friends, my agency is StreetGirls and I am a 22-year-old independent call girl available now. Everything you're looking for will find me, I love having sex without haste, I want to be your naughty girlfriend. I assure you that in privacy you will love my vagina, my sensuality, my charisma and I am available to serve you. Between four walls I'm hot and very naughty, I don't deny fire, I'll leave you breathless. In our appointment very passionately I will stimulate the erogenous areas of your body. I know that for you I will be an excellent company and an unmatched lover in intimacy.
    Call Girl Haridwar
    Call Girl Dhamtari
    Call Girl Mahim
    Call Girl Baga

    ReplyDelete
  14. Guys just sharing, I've found this interesting! Check it out!
    Erotic Massage Berlin

    ReplyDelete
  15. I would like to say thank you to visit my personal web page. I just made this website to work as an Independent Delhi Call Girls. Escorts services in bhiwadi
    Escorts in lajpat nagar
    Escorts in Bhiwadi
    escorts in goa

    ReplyDelete
  16. You are passed by on the basically referred to Call Girls Agency, and we are the social affair of entertainers. Our Goa Call Girls will without a doubt pull in you in the great fun which won't ever close. You discover trust in sexual satisfaction of our clients who are searching for the brilliant which they never have from another woman. The females have a few aptitudes to make your tendency on in a matter of seconds. Our Call Girls in Goa has been required to full filling the hankering regardless. We are serving Young and horny escort young people to a few areas and close about the Goa.

    Goa Escorts
    Call Girls in Goa
    Russian Escorts in Goa
    Russian Escorts Service in Goa
    Panjim Escorts
    Anjuna Escorts
    candolim Escorts
    Calangute Escorts
    Baga Escorts
    Arpora Escorts
    Escorts in South Goa
    Escorts in Goa

    Goa Escorts
    Call Girls in Goa
    Russian Escorts in Goa
    Russian Escorts Service in Goa
    Panjim Escorts
    Anjuna Escorts
    candolim Escorts
    Calangute Escorts
    Baga Escorts
    Arpora Escorts
    Escorts in South Goa
    Escorts in Goa

    ReplyDelete
  17. We will propose booking the entire night meeting so you can make it hotter with greater energy and sex joy. We have transferred the first pictures of Russian Goa escorts to our site and for knowing them more you should investigate their profile.

    Escorts in Goa
    Goa Escorts
    Call Girls in Goa
    Goa Call Girls
    Female Escorts in Goa
    Russian Escorts in goa
    Escorts in South Goa
    Goa Russian Escorts

    ReplyDelete
  18. Welcome Jaipur Escorts Service. We offer Escort Service in All Locations of Jaipur Like, Bani Park, Bais Godam, Bhankrota, Sanganer, Vaishali Nagar, Near Airport, Malviya Nagar, Kukas, Raja Park and More. So Your Can Book Call Girls in Jaipur at Your Local Place.

    Call Girls in Kukas
    Call Girls in Raja Park
    Call Girls in Vidhyadhar Nagar
    Call Girls in Bajaj Nagar

    ReplyDelete
  19. Our agency is known for working with the most elite nainital escorts. We also have the largest selection of profiles for the ladies in our pool. No matter what profile you choose for nainital escort service, we will provide the most relevant solutions to your needs and decisions. You'll have a wonderful and unique experience with us.
    nainital escort service
    haldwani escort service
    ramnagar escort service
    rudrapur escort service

    ReplyDelete
  20. bp doctor 3.0 pro wearable blood pressure smartwatch If you want to find an accurate fitness tracker, just try this smartwatch.

    ReplyDelete
  21. yhe bp doctor smartwatch Have a smart watch that you can use for exercise and daily life

    ReplyDelete
  22. Very informative Post, Keep Sharing such amazing content.
    Kind regards
    by Nanny
    by Vanny
    And canny

    ReplyDelete
  23. For example, did you know that in Indian cooking you should cook onions for at least thirty minutes, until they’re completely caramelised? Some dishes even require you to burn the onions a little bit for added flavour.

    Online Baking classes

    ReplyDelete