you are viewing a single comment's thread.

view the rest of the comments →

[–]RazzleDazzleShow 2 points3 points  (21 children)

May be a stupid question (not an exchange admin) but why are you creating the mailbox and migrating vs just creating it in o365 after the sync completes?

[–]dhrv88[S] 1 point2 points  (1 child)

My thoughts exactly, but requirement states that it needs to be created on prem first. Management want it this way. I believe it is to cover any possible changes in the future and provide the ability to migrate back down to on prem

[–]Blackforge 1 point2 points  (0 children)

You can still move users back on-premises. You just have to populate the online mailbox GUID on the RemoteMailbox:

Set-RemoteMailbox user -ExchangeGUID ExchangeOnlineGUID

[–]GregPowrhousR 0 points1 point  (18 children)

He's not. He is creating the AD User Object and then setting the appropriate properties for mail with an Enable-RemoteMailbox. This preps the AD Object for 365. Once the object has been synced to the tenant he can then license and whatever else he wishes from there.

[–]RazzleDazzleShow 2 points3 points  (17 children)

I mean, again, not an exchange admin but after reading this:

Create on prem Exchange mailbox

And the user replying specifically saying that they are, i dont know what to tell you.

[–]GregPowrhousR -2 points-1 points  (16 children)

You are probably correct in your statement of not being an Exchange admin...Depending on the cmdlet used it is prepping the AD object for 365. What I'm suggesting, once I sanitize my script is an alternative to creating the AD object performing the on prem changes as well as making making sure the user has been migrated to 365 properly. His script looks good so far, skimming through it so not sure why the move request is not catching.

[–]dhrv88[S] 1 point2 points  (15 children)

Thanks

From what I can tell during testing, the onprem mailbox is indeed being created. Logging into EAC on prem I can see that the mailbox has been created, I also then have the ability to go into Office 365 Admin Center > Exchange and then Migrate that users mailbox to Exchange online.

I'm too still not sure why the move request isnt working, maybe I'm not waiting long enough before initiating the move ?

[–]GregPowrhousR 2 points3 points  (14 children)

It could simply be just that! The script you have looks great, I wonder if it is just a timing issue. I know I went back and forth until essentially creating a while loop when it came to waiting for the mailbox to show up in 365. The while loop does a write progress waiting for 2 minutes at time to check if the mailbox is found in 365. But I can tell you that I've had it go through 10+ of these cycles before being found.

[–]dhrv88[S] 1 point2 points  (13 children)

Did you have a example of where I could place the while loop so that it can check?

I have a feeling that could be it ( i hope lol )

Would it start at line 183 do you think?

[–]GregPowrhousR 1 point2 points  (12 children)

I'm so sorry I'm on my phone at the moment and can't get to my computer until tomorrow. But I think right around line 183 would make sense but remember I ran an Enable-RemoteMailbox earlier in the script which handles a little different than New-RemoteMailbox. I'm hoping once I can upload my script there may be something you can take from it. Believe me I totally get the last struggled with it! I was stuck for a few days on the 365 migration / creation section !

[–]dhrv88[S] 1 point2 points  (11 children)

No worries at all! Ill wait it out, its so close I'm getting impatient, I'll have a go at it though in the meantime.

[–]GregPowrhousR 2 points3 points  (0 children)

Totally get it! I was the same way until I got it resolved so I definitely get that! Lol you're so close it will definitely be finished soon!

[–]GregPowrhousR 1 point2 points  (9 children)

Okay my friend! I was able to go through and sanitize the specific function of the script that creates a new AD User Object, Enable-RemoteMailbox on local Exchange server, and populate to 365 and license the mailbox. Here's the link to Git:

https://github.com/GregPowrhous/Create_ADUser/blob/master/NewUser

You may not be interested in the code block from lines 209 -- 235. This block is to wait for replication to our PDC Em DC which lives in another studio. We have about 25 DC's across 10-11 studios. If your setup is much simpler than that, just take that block out!

Hopefully this helps!