Forum Discussion
Change email domain in bulk via powershell
- Jul 25, 2023You can stop and close powershell, remove C:\Users\adm_acch006350\Documents\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.5 and try to install it again using nstall-module ExchangeOnlineManagement
get-module ExchangeOnlineManagement
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 3.2.0 ExchangeOnlineManagement {Add-VivaModuleFeaturePolicy, Get-ConnectionInfor…
)
- AnthonyChan_5mingJul 24, 2023Copper Contributor
I've run the update as follow, but still encounter same error:
-----------------------------------------------------------------------------------------------------
PS C:\WINDOWS\system32> update-module ExchangeOnlineManagement
PS C:\WINDOWS\system32> Get-InstalledModule ExchangeOnlineManagement | Format-List Name,Version,InstalledLocation
Name : ExchangeOnlineManagement
Version : 3.2.0
InstalledLocation : C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.2.0
PS C:\WINDOWS\system32> C:\Users\admin\OneDrive - XYZ\O365 - Migrate from old to new domain.ps1
Set-Mailbox : The term 'Set-Mailbox' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.-----------------------------------------------------------------------------------------------------
- Jul 24, 2023Did you start a new session and rerun the Connect-ExchangeOnline cmdlet? Afterward, the Set-Mailbox cmdlet should be available
- AnthonyChan_5mingJul 24, 2023Copper ContributorHarm_Veenstra
Yes, I've close and open new Window Powershell ISE as admin. This error regarding 'New-ExoPSSession' seems to be the culprit when i connect to ExchangeOnline, but i not sure what to do
---------------------------------------------------------------------------------------------------
PS C:\WINDOWS\system32> Connect-ExchangeOnline
----------------------------------------------------------------------------
The module allows access to all existing remote PowerShell (V1) cmdlets in addition to the 9 new, faster, and more reliable cmdlets.
|--------------------------------------------------------------------------|
| Old Cmdlets | New/Reliable/Faster Cmdlets |
|--------------------------------------------------------------------------|
| Get-CASMailbox | Get-EXOCASMailbox |
| Get-Mailbox | Get-EXOMailbox |
| Get-MailboxFolderPermission | Get-EXOMailboxFolderPermission |
| Get-MailboxFolderStatistics | Get-EXOMailboxFolderStatistics |
| Get-MailboxPermission | Get-EXOMailboxPermission |
| Get-MailboxStatistics | Get-EXOMailboxStatistics |
| Get-MobileDeviceStatistics | Get-EXOMobileDeviceStatistics |
| Get-Recipient | Get-EXORecipient |
| Get-RecipientPermission | Get-EXORecipientPermission |
|--------------------------------------------------------------------------|
To get additional information, run: Get-Help Connect-ExchangeOnline or check https://aka.ms/exops-docs
Send your product improvement suggestions and feedback to email address removed for privacy reasons. For issues related to the module, contact Microsoft support. Don't use
the feedback alias for problems or support issues.
----------------------------------------------------------------------------
New-ExoPSSession : Connecting to remote server outlook.office365.com failed with the following error message : For more information, see the
about_Remote_Troubleshooting Help topic.
At C:\Users\adm_acch006350\Documents\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.5\netFramework\ExchangeOnlineManagement.psm1:475 char:30
+ ... PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [New-ExoPSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException,Microsoft.Exchange.Management.ExoPowershellSnapin.NewExoPSSession
--------------------------------------------------------------------------------------------------------