Skip to content
Joe Crockett edited this page Apr 18, 2018 · 5 revisions

Welcome to the CoaOnlineModule wiki!

What it does

  • License Microsoft Online users & mailboxes
  • Remove users licenses
  • Set common Exchange Online policies to mailboxes

How to get started

See those instructions on the ReadMe!

How to start everyday

See below on how to start initially

  1. Launch Microsoft Exchange Online PowerShell module
  2. Import the cmdlets into the shell:
    Import-Module MSOnline, CoaOnlineModule
  1. Use the two cmdlets to connect to Microsoft
    Connect-MsolService
    Connect-EXOPSSession
  1. [Optional] Review the variables in use by using the cmdlet
    Get-CoaVariables

User Operations

License and create a mailbox for a single user that was created by the service desk

  1. Type the cmdlet to create the user in the shell first
    New-CoaUser test.user | Set-CoaExchangeAttributes | Set-CoaExoAttributes

If you'd like to create a firstline worker, use the switch -Firstline

    New-CoaUser test.user -Firstline | Set-CoaExchangeAttributes | Set-CoaExoAttributes

License and create a mailbox for a single, new user, that hasn't been synced yet

  1. Type the cmdlet to create the user in the shell first
    New-CoaUser test.user | Set-CoaExchangeAttributes

If you'd like to create a firstline worker, use the switch -Firstline

    New-CoaUser test.user -Firstline | Set-CoaExchangeAttributes
  1. Run Azure AD Connect delta sync - this will sync the attributes set in AD to AzureAD

This is done on the Azure AD Connect box, running its module as administrator

    Start-ADSyncSyncCycle -PolicyType Delta
  1. Wait for Azure AD Connect to finish
  2. Type the cmdlet to license the user and create the mailbox
    Set-CoaExoAttributes -UserList $CoaUsersToWorkThrough

License and create mailboxes for multiple users (either new or synced)

In order to create multiple mailboxes, one creates a batch of users using the New-CoaUser cmdlet for each user, which outputs its 'batch' of users to the $CoaUsersToWorkThrough

$CoaUsersToWorkThrough is a variable created by the module in the Global scope.

  1. Create the new users
    New-CoaUser test.user1
    New-CoaUser test.user2 -Firstline
  1. Set the Active Directory attributes of the batch
    Set-CoaExchangeAttributes -UserList $CoaUsersToWorkThrough
  1. Run Azure AD Connect delta sync - this will sync the attributes set in AD to AzureAD

This is done on the Azure AD Connect box, running its module as administrator

    Start-ADSyncSyncCycle -PolicyType Delta
  1. Wait for Azure AD Connect to finish
  2. Set the attributes for Exchange Online of the batch
    Set-CoaExoAttributes -UserList $CoaUsersToWorkThrough

Remove licenses and set termination attributes to the AD object and mailbox for a single user

Though the verb of the cmdlet is Remove, it should be noted, it doesn't remove the user, just the licenses.

  1. The following command will remove the license and set the appropriate attributes for a term user
    Remove-CoaUser -SamAccountName test.user

Remove licenses and set termination attributes to the AD object and mailbox for multiple users

Though the verb of the cmdlet is Remove, it should be noted, it doesn't remove the user, just the licenses.

  1. The following command will remove the license and set the appropriate attributes for a comma separated list of term users
    Remove-CoaUser -CommaSeparatedSamAccountName "test.user1","test.user2"

Mailbox Configuration

These configuration modifications put the mailbox in-policy for COA business needs. This needs to be done more than one hour after mailbox creation.

    Set-CoaMailboxConfiguration

To view the various parameters of the mailbox configuration script:

    Get-CoaVariables

To modify the default parameters of the configuration:

To be done before the Set!

    Set-CoaVariables -Domain "testalexandriava.gov" -CoaSkuFirstlineWorkers = "TESTALEXANDRIAVA:DESKLESSPACK_GOV"