Jump to content

Powershell Exchange online "The domain controller xxx is not available for use...


Recommended Posts

Posted

Hi all,

 

I am trying to run a PowerShell script to modify an attribute for subset of users in Exchange online (Office 365).

 

"The domain controller xxx is not available for use at the moment" (there is a load of other gumph in red text but this is the crux of the error).

 

And the script stops at this point.

 

I have also seen this happen before and seems to occur when a script takes a while/does a lot of processing in Azure (i.e. goes through a batch of users), but not always.

 

It's quite frustrating because it stops me from making this change. Has anyone seen this before?

 

Kind Regards,

 

Bruce.

Posted
Hi all,

 

I am trying to run a PowerShell script to modify an attribute for subset of users in Exchange online (Office 365).

 

"The domain controller xxx is not available for use at the moment" (there is a load of other gumph in red text but this is the crux of the error).

 

And the script stops at this point.

 

I have also seen this happen before and seems to occur when a script takes a while/does a lot of processing in Azure (i.e. goes through a batch of users), but not always.

 

It's quite frustrating because it stops me from making this change. Has anyone seen this before?

 

Kind Regards,

 

Bruce.

 

I don't think I'm giving too much away pasting the full error (with name of host replaced with xyz):

 

Microsoft.Exchange.Provisioning.ProvisioningBrokerException: Provisioning layer initialization failed: 'The domain

controller 'xyz.eurprd06.prod.outlook.com' is not available for use at the moment. Please try again.' --->

Microsoft.Exchange.Data.Directory.ServerInMMException: The domain controller

'xyz.eurprd06.prod.outlook.com' is not available for use at the moment. Please try again.

Posted
Even the entire host name would not give anything away its shared with more than your tenant, not that it makes much difference to the error. Is this happening every time you run your script/ command? If its a script can you share the command/ script block that is actually being run at the time the exception is thrown?
Posted
Even the entire host name would not give anything away its shared with more than your tenant, not that it makes much difference to the error. Is this happening every time you run your script/ command? If its a script can you share the command/ script block that is actually being run at the time the exception is thrown?

 

Thought that was probably the case, but wasn't 100% sure.

 

Get-DistributionGroupMember -Identity "Distribution list" -ResultSize Unlimited | Set-MailboxRegionalConfiguration -Language 2057 -TimeZone "GMT Standard Time" -DateFormat "dd/MM/yyyy" -TimeFormat "hh:mm tt"

 

Goes through all members of the list and modifies the attributes relating to Language/TimeZone/Date Format.

 

I am only having to do this due to Office 365/Exchange defaulting new users to US.

 

When I first ran it there are warnings about a xxx ms delay being inserted due to the load imposed on the server. Fine.

 

But after running again this happened. And when I tried again the following day, from a different Internet connection.

 

Like I said I've see this error before when attempting to make batch changes to users in online Exchange.

 

Thanks,

 

Bruce.

Posted (edited)
I have seen this before.... The delay is expected and can be handled as I have covered in the past on here. How many accounts are being returned from that Get-distributiongroupmember? Edited by HPlum78
Posted (edited)

So I have come across this when doing the same kind of batch operations, essentially that get grabs all the account objects by querying the underlying directory then those are being piped into that set problem is that the underlying object has changed (moved from one host to another) and this is when you see that error being thrown. Need to refractor how you are getting the accounts that need to be processed.

 

So in my mind get all the objects with the group filter and then pass those in to a loop that essentially gets the account object again before doing the set. Put it in a try catch so that you can decide how and what you are going to do if you encounter an error. This way you could iterate through the accounts on the initial pass and those that fail could be put into an array and those accounts could be retried. Lots of options just need to handle that error and make it none terminating.

Edited by HPlum78
  • 6 months later...
Posted
EXOPS single-user permission assign or batch multi-user permissions | piped batch has nothing to do with it. This is happening with multiple admins in our tenant and has been slowly worsening for us. We have a premier support ticket open with Microsoft and no solution yet.
Posted (edited)
The | don't change the error (as noted in my earlier response) the object has moved its written in the error. Unless MS are going to rewrite how EXO works this will always be a thing and needs to be solved in your code.... Edited by HPlum78
Posted

While I think about this (and the OPs issue) using a Graph call will actually solve the issue as it proxies the update to the user that needs updating

https://docs.microsoft.com/en-us/graph/api/user-update-mailboxsettings?view=graph-rest-1.0&tabs=http

 

The above gives some insights and to be fair will alleviate a lot of these issues (if a corresponding graph endpoint exists for the attribute you are trying to manipulate)

Posted (edited)
And while I think (continue to think) about this are you now using the exo v2 module? As they have done a ton of work on these and have reduced the property bag that gets returned. So the v1 commands will return the thick wedge of 250 properties and the new commands return ~10, this has a dramatic effect on the performance of running the commands. Edited by HPlum78

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...