Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Exchange Online is a cloud-based email service that is part of Microsoft 365. To manage Exchange Online, administrators can use the ExchangeOnlineManagement module in PowerShell, which allows for efficient and automated management of email settings, users, and other components.
Before managing Exchange Online via PowerShell, you need to install the ExchangeOnlineManagement module. This module is available from the PowerShell Gallery.
Open PowerShell as an Administrator:
Press Win + X
and select "Windows PowerShell (Admin)" from the menu.
Install the ExchangeOnlineManagement Module:
Run the following command to install the module from the PowerShell Gallery:
Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser -Force
This command installs the module for the current user. The -Force
parameter ensures that any prompts are automatically accepted.
Once the module is installed, you can connect to your Exchange Online environment.
Import the Module:
Load the module into your PowerShell session with:
Import-Module ExchangeOnlineManagement
Connect to Exchange Online:
Use the Connect-ExchangeOnline
cmdlet to authenticate and connect:
Connect-ExchangeOnline -UserPrincipalName your-email@domain.com -ShowProgress $true
Replace your-email@domain.com
with your actual email address. You will be prompted to enter your password.
After connecting, you can perform various management tasks. For example, to list all mailboxes:
Get-Mailbox -ResultSize Unlimited
This command retrieves all mailboxes in your organization.
To create a new user mailbox, use the New-Mailbox
cmdlet:
New-Mailbox -UserPrincipalName newuser@domain.com -Alias newuser -FirstName New -LastName User -Password (ConvertTo-SecureString 'P@ssw0rd' -AsPlainText -Force)
Replace the placeholders with the appropriate values for the new user.
Once you have completed your tasks, disconnect from Exchange Online:
Disconnect-ExchangeOnline -Confirm:$false
This command ends your session without prompting for confirmation.