Invalid namespace – EventID 906 – AD Azure Sync Tool (WAAD)

Today I came across an interesting issue where the AD Azure Sync Tool via Microsoft Online alerted me that AD Azure Sync had failed to run for some time!

errorADAzure

This was quite odd as there had been no changes to the Office 365 or AD instances that provide the identity sources for this AD Azure Sync. There were some power outages in their server room that caused a few other services to not come up clean so I thought it could be that the service failed to start etc. Monitoring by SCOM said otherwise though! Okay time for checking the event logs and within a few seconds found this.

errorADAzure2

Interesting! EventID 906 "Invalid Namespace"… That's the same issues that appeared with the old DIRSYNC.exe when the WMI object had unregistered itself. Common for example if you have SCCM client installed on the server or something else goes through and manipulates the WMI classes probably where it shouldn't be. Okay, let's fix this quickly without having to reinstall anything… Something that you had to do with DIRSYNC.exe. A total pain in the backside, and if you weren't careful, you could have ended up with a boatload of disconnected objects in the metaverse!

At this point I had a choice. Do these steps manually or create a dirty batch script that will do the work for me and if needed in the future, on demand. I decided to do both, ran the steps manually and once I was happy with it, save my work into the batch file for future use!

So below is my script that I first ran the commands or enacted the same thing the script would do with the GUI. Once I actually had it all set up and AD Azure working again, I actually ran the new script again (over the top of my manual work) to confirm that the script was safe. And sure enough, it was and everything was working fine after the script ran.

To break down what the script does here is a list of what each row does. 

  1. 'mofcomp' parses the MMS (FIM) wmi file and goes through the process of adding the classes etc. to the WMI repository.
  2. 'regsvr32' then registers the WMI .dll file to the server.
  3. 'net stop winmgt /y' stops the WMI management services and its dependancies.
  4. The following 'net start' commands then start the services stopped when we fired off the 'net stop'. The services are also started in the correct order.
  5. Finally, we run AD Azure Sync manually by calling "DirectorySyncClientCmd.exe". 
mofcomp "D:\Program Files\Microsoft Azure AD Sync\Bin\mmswmi.mof"
regsvr32 /s "D:\Program Files\Microsoft Azure AD Sync\Bin\mmswmi.dll"

net stop winmgmt /y
net start winmgmt
net start "IP Helper"
net start "User Access Logging Service"
net start "Microsoft Azure AD Sync"

"D:\Program Files\Microsoft Azure AD Sync\Bin\DirectorySyncClientCmd.exe"

As you can see the directory for which AD Auzre has been installed is the D: drive. You can change this batch file with %Program Files% if you're using your system drive (C:).

That's it from me for now. I hope this helps others in the future using the AD Azure Sync Tool! 

Azure Active Directory (WAAD) Sync Tool – Password Sync issue and the importance of running the entire wizard

Today I came across an interesting find with the Azure AD Sync Tool that I thought I would share. The issue was rather easy to identify but someone with an untrained eye might find it confusing or a little misleading. When I say untrained this article is really for those who may be going alone with an Office 365 migration for the first time for their business or in a test lab… Though the semi-professional administrator may find this interesting.

To give you a bit of history about my knowledge on this, I come from the Forefront Identity Management 2010 (FIM) head space in that when myself and Lain rebuilt a major university's IT infrastructure back in 2010-2011 we didn't have the freedom that comes with Office 365 / Azure AD today. I.e. It was FIM, FIM or, and you've guessed it, FIM. So when we built our management agents and the subsequent metaverse, it was staggered in order so that once everything was in place and we were happy with it, we'd go back and implement Password Change Notification Services (PCNS) as the last step.

Coming back to today however there are three options out there for us to use for directory synchronisation. Those being of course:

  • DirSync. The widely used directory sync tool out there for many clients. It has served its purpose and proven to be a suitable solution for many organisations who just need basic Office 365 attribute flow etc. 
  • Azure AD Sync. The now standard and recommended solution for those looking to directory sync with Azure and Office 365. Those who are about to begin with directory sync this is the current recommended tool by Microsoft. Deter away from using DirSync as the eventual plan for that tool is for it to be put to pasture. The great thing about Azure AD Sync is that it supports multiple AD forests and password write back. Password write back shouldn't be confused with Password Sync by the way! They are two different things with two very different outcomes, especially around security implications!
  • FIM. Lastly FIM is for those who need the ability to customise management agent's (MA's) to the needs of their business. An example where FIM is very powerful is where you have say a HR system (based on say SQL) that flows into an on-premise AD. Meaning your HR system is in fact the definitive source for identity management within your organisation. From AD however you then establish lots of different ADLDS instances for proprietary systems that you might not want talking or bloating AD itself (E.g. Cisco CUCM and Avaya UCM are two strong canidates for ADLDS). Then of course you configure the Office 365 MA and PCNS for provisioning to the Azure cloud.

There is actually a fourth option to this list above but it's only in a Public Preview at the moment. Going by the name AD Azure Connect, this product makes massive inroads for making ADFS federation a hell of a lot easier for the inexperienced administrator. Essentially you only need to provide it with the right certificate and create some DNS records and it configures ADFS for you. It's evident when comparing the four DirSync and Azure AD Sync look somewhat primitive and that Microsoft with this new tool are really pushing the customer base away from Same Sign-On to Single Sign-On (SSO). Unfortunately its hard to compare it with FIM as it is much more powerful in terms of configuration but also to the fact Microsoft haven't really stated what FIM's future is at the moment… I guess we'll know more when AD Azure Connect becomes GA.

So now back to my issue (sorry, got sidetracked). When I was going through the process of installing the Azure AD Sync Tool in a test lab I thought I'd be smart about making sure my metaverse wouldn't be filled up with unnecessary and unneeded objects (User and Groups) from my on-premise AD. When I say unneeded, I don't for example need groups such as "Domain Admins" synchronised to the cloud. Why? Well Office 365 doesn't need them and realistically, neither does your organisation. They for example wouldn't be using "Domain Admins" as a email distribution group and administrative privileges at the Office 365 at least are done at the user level not by groups! Of course you're wanted Lync and Exchange RBAC controls you may have a need for "Domain Admins" but again your probably don't either.

So when it came to the final screen on the wizard I unselected the "Synchronize now" checkbox. No problem as I'll change the filter on my on-premise AD Management Agent first (to pick a subset of OU's) and then run my first Full Import sync on both MA's manually. Done that, great… Now run the first sync by calling the DirectorySyncClientCmd.exe in the install location 'Bin' folder. Done. Awesome! I have got only the users and groups I needed in Azure AD and there is no initial 'disconnectors' in my metaverse. Time to assign licenses and get users on Office 365! 

Now at the point I thought everything was great and I was ready to go… I attempt to login to the Office 365 portal with one of my synchronised accounts but I'm getting told it's not the right username and password combination. Hrmm, turns out I'm not close…. So what's gone wrong?

Well after a quick look at Event Viewer connected to the server running the Azure AD Sync tool I knew my problem straight away…. 

eventvwr-ADAzure

Event 652! But I told the wizard back at Step 4 that I wanted Password Synchronisation. What's going on?!

Well turns out if you choose not to run that first initial sync with the wizard, you're PCNS is not registered on the sever. In a way that does make sense because for PCNS to work you really do need accounts in the cloud to password sync too. But on the other hand it should be able to wait until the first 'Delta Imports and Exports' are run to go, okay, time to grab the password hashes and sync them because there is something there that is new and synced… Much as the case with a new user you create in on-premise AD and eventually syncs to the cloud. For those who don't know PCNS is run completely independent of the the sync tool and the scheduled task I'm about to talk about so I thought that the latter thought of mine would make the most sense. However it's clear with the application event log Microsoft have built the tool in a way that is contrary to that.

So what's the lesson here? Well if you want to change your on-premise AD MA filters before you run the first 'Full Imports' manually you really need to actually kick off the wizard first with 'Password Synchronization' on step 4 (Optional Features) unchecked. Once you've done what you've need to do with the OU filters etc., you need to disable (not delete) the newly created task in Task Schedular, run the wizard again, enable 'Password Synchronization' and save. Again to just remind you, you don't need to run the sync again because PCNS is independent of this. 

Once that's all done, confirm the task as enabled again and if it hasn't, enable it manually. You should find also that your event log is full of Event 657 informing you that PCNS is syncing passwords propery.

Finally and this is just a quick note, if you have gone through the wizard already with Password Synchronisation enabled but you didn't let the wizard run the first sync, then you'll need to add in an additional step prior to the steps above that goes through the wizard first disabling Password Synchronisation. This is because the wizard does not go off and run everything again if it determines there are no changes to be made as you have made any selection changes etc.‚Äč

Happy syncing! 

Microsoft Partner Network – Resell and or offer free trials for Office 365

So this article is going to help those who may be new to the Microsoft Partner Network and want to resell or even just offer free trials to Office 365. I've seen quite a bit of confusion around the internet especially on TechNet about how a partner gains the ability to resell and offer trials so hopefully this article should clear it up and give the necessary steps to get going!

One thing I do want to raise or warn about however is that for someone who doesn't know Office 365 all that well, especially around the licensing options it offers should refrain from trying to resell it or offer free trials on behalf of your organisation until you do. Office 365 is a beast and shouldn't be treated with someone poking it with a stick! Those who are knowledgeable should be the only professionals offering Office 365! You can really hurt your organisation and even the customers if you start offering the wrong licenses etc. 

For those who may not understand licensing, please refer to https://getlicensingready.com/. This portal is very good in providing you with the right tools to tackle Microsoft licensing. 

To begin it's obvious that you'll need to be a Microsoft Partner Network organisation. On top of this you must have completed the competency exam/ test and purchased a Microsoft Action Pack. If you haven't completed your competency exam/ test and subsequently don't have a Microsoft Action Pack you won't be able to resell Office 365. Why? Well the organisation needs Office 365 to resell Office 365 and the only way that is possible without having an Enterprise Agreement or using a reseller like Telstra (Australian customers only) is to be a holder of an Action Pack.

Complete those prerequisites before going on with this article.

Part 1: MOSPA

The first requirement for reselling Microsoft services is to be a member of the Microsoft Online Services Partner Agreement. The following steps should allow you to sign up and register for just that!

  1. First log into the Microsoft Partner Network and view your organisations membership. From there head your "Requirements & Assets > Manage Compentencies".
  2. At the bottom of the new page you'll be presented with a couple of options under the heading of "Additional Programs". In order to sell Office 365 you must enrolled for "Microsoft Online Services Partner Agreement, otherwise known as MOSPA. So click on the "Status" link for that.
    mospa
     
  3. Read carefully the agreement and sign up for it if you're happy to proceed. 
  4. Complete the relevant documentation around the tax and banking information. This varies from country to country so please make sure you follow the steps very carefully.
  5. Wait for the response email or notification from Microsoft that you have confirmed your billing information.

 

Part 2: Registering for Office 365

Get your Office 365 subscription as part of you MPN Action Pack by following the steps at https://support.microsoft.com/en-us/kb/3007588. There is no need for me to repeat the robust instructions on that KB article here! 

 

Part 3: Resell and offering free trials in Office 365

After completing parts 1 and 2 you're now ready to resell and offer free trials in Office 365! But you're probably thinking how right? You don't see any option in the Office 365 Administrator Portal to complete such function! Well to do this you need to use an account with "Global Administrator" rights on your Office 365 subscription and head to https://portal.office.com/partner/default.aspx. From here you're able to complete the first trials or purchase orders by using the "Build your business" link on the left hand pane.

office365-partner

Also of interest here is the "Request delegate admin permissions" option. This is for the situation where an existing customer of Office 365 may become a new client of your IT consultancy business. So in other words, you're asking to be able to make changes to their existing Office 365 subscription once you've been given the access.

 

Part 4: Using Microsoft marketing material (optional)

Personally I really like Microsoft's marketing material around Office 365 for Microsoft Partners. Not only is it just easier to use their advertising and not worry about designing it yourself, the adverts are very professional and do give your organisation that edge in my opinion against others who do it on their own and poorly… Telstra in Australia for example really fail to promote Office 365 for what it does and that's one of the biggest problems with people and organisations alike taking it on. If it doesn't make sense they'll stay away from it.

If you're wanting potential customers to leverage your free trial offers but rather don't want to have to send a unique one out each time, you can use the same trial on one advert that is shared. To to this complete the following:

  1. In the Office 365 Partner Portal, create a free trial with the licenses etc. you want to offer.
  2. On the "Send" page copy the URL from the text are and keep it handy. You'll need it later on.
  3. Click Finish to compelte the trial. Once you've done that you're actually finished with the Office 365 Partner portal and can log out it if you wish.
  4. Log into the Microsoft Partner Network again if you have previously logged out.
  5. Head to "Resources > Marketing > Overview".
  6. On the new page, select "Syndicated Marketing".
  7. Because in this situation we're offering free trials of Office 365 to our potential customers, select the "Office 365 with trial option"
  8. Select "Customize".
  9. Complete all the details on the customise page that you need for the invitation URL, copy and paste the URL you grabbed from step 2.
  10. Click "Generate Code". 
  11. With the generated code, use it as you please either in your organisations website, promotional HTML email or any other advertising medium. When uses click on that link and register for the free trial, they'll be using your organisations offering and you'll be able to (if you selected it in step 1) control their subscription with delegated admin rights. Once the trial is over you can speak to the customer and hopefully, if the trial has gone well get them onto Office 365 and secure the deal!

That's it for now. Any questions or queries please don't hesitate to ask!