Hey Tim,
Not an emergency, but I had a chance to try the –IsCloud for a secondary mailbox. It didn’t work so I just did it the old way and will let migrate.
Here’s the output I got on the screen:
The errors continue, but are not critical to this discussion.
Breaking it down
PowerShell errors are sequential, so you should always focus on the first error message you see, fix that, and then retry. Move forward one error at a time.
So, to do that:
In this case, our first exception is related to a cmdlet not being found. The text
tells you where to look in the script to find the exception message. The text
tells you what command generated this message. In this case, let’s look at that in the code…
We can see that this is probably a script that hasn’t been edited in a while by the dates. The offending line is:
Since the exception is that the cmdlet couldn’t be found, let’s look at that directory:
Well, there you have it. We don’t have a directory that contains the file. What happened? Likely, we modified the structure of all of our scripts and didn’t have note of all of the scripts dependencies. In this case, we can resolve this error by updating the code to point to the new code location: C:\Automate\Includes\ConnectToO365\Connect-ToO365.ps1
Going to the next error in line, you can see that it is the same general error as before:
In this case, the error makes sense. The New-Mailbox cmdlet is loaded as part of the Connect-ToO365 script. The remaining errors are similar cmdlets that failed to load when we didn’t create the connection to Office 365 or are errors because they are trying to modify a mailbox that failed to create.