You need to keep at least one Exchange box for management purposes and tasks like this one. While technically you can run the PowerShell cmdlet remotely from any machine within your environment, it still needs to be proxied through an Exchange server, so there's no way for such scenario to work without an actual Exchange box.
Enable-RemoteMailbox to create mailbox on Exchange Online when user is created in on-prem Active Directory
Hello,
I am looking for an option to create a mailbox on Exchange Online when a user is created in my on-prem Active Directory. However I do not want to maintain my hybrid exchange server. I would like the Enable-RemoteMailbox executed from a non-exchange Windows Server.
Can I execute the Enable-RemoteMailbox from a non-exchange Windows server?
If yes what is the module I need to install to use the Enable-RemoteMailbox cmdlet/function from my powershell script.
Thank you.
2 answers
Sort by: Most helpful
-
-
Lucas Liu-MSFT 6,176 Reputation points
2021-02-08T06:57:20.753+00:00 Hi @Anonymous ,
You could run the following command in the Winodws PowerShell to connect to Exchange server by using remote PowerShell. This is so that those local computers that have not installed the exchange management tool can also manage the Exchange server. But as michev said, if you want to ensure that the command line can be executed normally, then you need to ensure that your Exchange server can work normally.$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<ServerFQDN>/PowerShell/ -Authentication Kerberos -Credential $UserCredential Import-PSSession $Session –DisableNameChecking
For more information you could refer to: Connect to Exchange servers using remote PowerShell
Below screenshot is the test in my lab environment:
----------
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.