Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Manage Exchange Online with ExchangeOnlineManagement in Windows PowerShell

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.

Examples:

Installing the ExchangeOnlineManagement Module

Before managing Exchange Online via PowerShell, you need to install the ExchangeOnlineManagement module. This module is available from the PowerShell Gallery.

  1. Open PowerShell as an Administrator:

    Press Win + X and select "Windows PowerShell (Admin)" from the menu.

  2. 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.

Connecting to Exchange Online

Once the module is installed, you can connect to your Exchange Online environment.

  1. Import the Module:

    Load the module into your PowerShell session with:

    Import-Module ExchangeOnlineManagement
  2. 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.

Managing Mailboxes

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.

Creating a New Mailbox

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.

Disconnecting from Exchange Online

Once you have completed your tasks, disconnect from Exchange Online:

Disconnect-ExchangeOnline -Confirm:$false

This command ends your session without prompting for confirmation.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.