Platform:
Source: All > Destination: Exchange 2010 / Office 365
Problem
When migrating to Exchange 2010/Office 365, the following error is seen:
Unable to run Powershell (Init)
Solution
This indicates there was a problem running the PowerShell init script. Check the exact error message for more details. If the error message below is seen, then this indicates there was a problem connecting to the PowerShell session.
Message: Cannot validate argument on parameter ‘Session’. The argument is null. Supply a non-null argument and try the command again
If this error is seen when generating user lists on Exchange 2010, it probably means you need to modify the ‘Get User Init Script’ for Exchange 2010. See this article as the same changes should be made to the Get User Init Script.
If the init script does not start with the line $ErrorActionPreference = 'Stop'
, then you should add this as the first line of the init script. The init script should then look something like the following (although this may change depending on whether you are migrating to Exchange 2010 or Office 365). When this change has been made, run the migration again and a more descriptive error message should be produced.
# Set this so that errors are thrown from Cmdlets $ErrorActionPreference = 'Stop' # Open the connection $sesh = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://myserver.com/powershell -credential (New-Object -TypeName System.Management.Automation.PSCredential -argumentlist '[!admin-email]',(ConvertTo-SecureString '[!admin-password]' -AsPlainText -Force)) -Authentication Basic -AllowRedirection # Import the session $imp = Import-PSSession -Session $sesh
Comments
0 comments
Please sign in to leave a comment.