Exchange online powershell

Exchange Online |

Microsoft Office 365 is a software plus services offering from Microsoft, the successor to the existing offering Business Productivity Online Suite. The following services are included in the initial release of Office 365:

  • Exchange Online
  • Lync Online
  • Sharepoint Online
  • Office Professional Plus 2010

One major advantage in Office 365 compared to the previous version is the ability to offer single sign-on, also referred to as identity federation, which makes  the offering more attractive for enterprises. Another feature that makes it attractive for larger environments is the greatly enhanced support for administration using Windows PowerShell. Many of the PowerShell capabilities are built on the remoting capabilities in PowerShell version 2, while some requires installation of a PowerShell snapin or module.

Office 365 PowerShell Management Interface

The Office 365 PowerShell Management Interface offers the ability to administer service-wide features, and is not limited to a specific service like i.e. Exchange Online. The initial features that can be administered using this interface include the following:

There are three basic steps for connecting to Exchange Online with PowerShell, and you’ll find these in official help documentation on TechNet as well as on many blogs. The steps are:

[PS] C:\Windows\system32>Get-Mailbox | Select-Object Name,WhenCreated > c:\xfer\report.txt

2. Массовое создание пользователей из CSV файла

Еще один типичный сценарий администрирования Exchange – массовое создание пользователей из CSV файла.Может использоваться при миграции пользователей из другого окружения, при слияниях компаний или просто большом найме новых сотрудников. Для этого сценария типично использование CSV файлов. Для начала нужно подготовить CSV файл. Если администратор имеет желание облегчить себе задачу по последующему изменению атрибутов пользователей, то логично предусмотреть все заранее. При миграции или переезде пользователей с ActiveDirectory-based окружения, экспортирование нужных AD атрибутов пользователей позволит быстро их создать на новом месте, в новой ActiveDirectory.

Экспортируем через get-user, производим выборку по нужным атрибутам и передаем полученный результат в CSV файл.

Теперь у нас есть полностью готовый к последующему импорту CSV файл. В большинстве случаев хватает такого набора информации в CSV файле:

$importresults = Import-PSSession $s

Create a Skype for Business Powershell session using defined credential.

PowerShell for Exchange Online

Connecting to Exchange Online with PowerShell is easy -- it does not require any extra software to install. This connection simply relies on PowerShell's remote sessions to connect to the Exchange Online endpoint and to import all of the available cmdlets.

In the case of connecting to Exchange Server 2010, 2013:

In the case of connecting to Exchange Online (Office 365):

For information about Exchange Online PowerShell cmdlets available see Reference to Available PowerShell Cmdlets in Exchange Online.

Import-PSSession $Session

  • Don’t collect more data than you really need to
  • Use different Office 365 user accounts for different tasks when connecting to Exchange Online using PowerShell
  • Free up PowerShell sessions when you’re done using them by running Get-PSSession | Remove-PSSession
  • Use the -ResultSize switch when using Get-User or Get-Mailbox to limit the number of results returned
  • Use the -Filter switch instead of the Where-Object cmdlet to filter datasets. Filter is applied server side and is much faster.

For more information on Exchange Throttling Policies see:
Exchange 2010 Client Throttling Policies
Understanding Client Throttling Policies