1. Help Center
  2. Integrations and Security
  3. Microsoft Exchange and Exchange Online

Create a service account using PowerShell  

Learn how to create a service account in your Exchange Environment using PowerShell

In order to integrate with Exchange Server using Basic Authentication, you must be a Global Administrator in your organization's Azure Active Directory.
  • Open the Exchange management shell and run the following command:
New-Mailbox -UserPrincipalName sa@domain -Alias SA -Name serviceaccount - OrganizationalUnit Users -FirstName Service -LastName Account -DisplayName "Service Account"

Make sure "domain" is replaced with the domain of your organization. The shell will prompt you to enter a password for the new user. This password will later be used to connect the service to the AskCody management portal. 

  • In the Exchange management shell, run the command:
New-ManagementRoleAssignment –Role:ApplicationImpersonation –User:InsertNameOfServiceAccount

Remember to insert the name of your service account in the command. If you have named the service account as shown in step 1, the command should look like this:

New-ManagementRoleAssignment –Role:ApplicationImpersonation –User:serviceaccount