Управление outlook через powershell
In this post, App Dev Manager Edward Fry demonstrates how to use Microsoft Outlook Object Library from PowerShell.
Time is a precious commodity. For many professionals, there just aren’t enough hours to accomplish all the tasks in a day. Thankfully, today’s world thrives on automation. Computers can perform painstaking, mundane tasks in a matter of seconds, leaving you the extra time to work on a multitude of more mentally intensive jobs. Whether you have an advanced technical degree or just use the computer for day-to-day tasks, it isn’t too hard to make the computer your personal assistant.
For this article, let’s focus on a specific type of task that is common for many professionals: sending out reports. While the specifics will vary, this scenario typically involves generating reports on some area of business interest and then sending those reports to recipients of interest. Of course, one way to approach this task would be to have each interested party look at their own reports or dashboards.
However, this isn’t always feasible. For instance, your users may be executives who don’t have the time for managing their own reporting. Or you might be in sales or services and need to share reports with your customers. Sharing that information is just part of the service that you provide, so it wouldn’t be appropriate to offload such a task to your customers. These are only two possible scenarios where you need to push reports to others rather than (or in addition to) having them pull their own.
An additional constraint, though, is that your report recipients must all be separated from each other. One executive might not need to know or care about another’s area of focus. One customer should not see or even be aware of other customers’ reports for privacy reasons. This constraint adds some complexity and work to the process. Wouldn’t it be nice to have the computer be your personal assistant and take care of all that for you?
Our goal in this article is to automate the download of periodic reports, associated processing, and dissemination to recipients via discrete outgoing messages with relevant attachments. For this article, I am assuming that the reports come from a reporting tool that allows email subscriptions, like SQL Server Reporting Services (SSRS), that Outlook is the email client, and some basic PowerShell knowledge.
By the way, you don’t have to be a seasoned developer in order to pull this off; anyone with a little PowerShell experience can benefit. Every information professional will benefit from some basic scripting ability in a language like PowerShell, and I highly recommend setting aside some time to learn this useful practical skill. If you need the basics, check out some of the free resources that are available.
Before we get to the scripting, we need to set some things up. This will make the script easier to code, and it will enable easier management as things change over time.
Report Delivery
A key component of this solution is that the reports you need to send out are delivered to your inbox. Of course, it’s possible to run them manually and save them off, and there’s a solution for automating those, too (though that is outside the scope of this article), but it is much easier to have them come to you.
Oftentimes, people are not aware that you can automate report delivery in SSRS. It is quite simple and involves just pre-selecting the filters of interest and a delivery schedule – for instance, once a month or once a week, etc.
When you set up your subscription, be sure to select the type of report that you wish to distribute. Since PDF is the most common file type for this sort of scenario, we will assume the reports are delivered in PDF format for the rest of this article.
Recipients
Typing in a list of recipients each time you need to send out reports is tedious and error-prone. Instead of doing that, let’s add a layer of abstraction to the process. In our case, we will use Outlook groups to refer to recipients as a group rather than by name. As you can see in the image below, you create a group for each type of recipient for each destination. For instance, our example here assumes customer recipients. You would make an Outlook group for primary recipients, one for CC, etc. Check out how to make groups in Outlook HERE.
For each group, then, you simply add the actual people who will need to receive the reports. That could be one person or a lot of people. As contacts change, all you need to do is keep these groups up to date, and the automation script will implicitly pick those changes up without any need to modify the code.
Template Emails
We also need a template email. In the image above, you can see that our template includes the message that we want to send to our recipients along with some tags that will be replaced in our script. To create an email template, go HERE.
File System
In this optional but recommended step, organize your folder structure so that you can save a copy of each report automatically for your records. Setting up an organized filing system is key to keeping the files organized and easy to locate in the future.
Once the reports of interest show up in your inbox at the designated time from SSRS, our automation will follow these steps:
- Connect to Outlook
- Open the emails and save the PDF to the proper folder in your filing system for backup purposes. I like to rename each PDF with something meaningful to the recipient and report. For example: (CompanyName)(ReportTitle)(Date).pdf
- Process Reports
- Attach the PDF into the analogous email template.
- Expand the To and CC recipient groups.
- Customize the message as needed.
Connect to Outlook
Process Reports
Now we can finally process those emails that were sent by SSRS automatically with the report PDFs.
With our handy Outlook namespace object in hand, we can now get references to other objects and commands within Outlook. First, we’ll get a reference to the inbox and the emails that match our criteria within the inbox.
Prepare Outgoing Emails
Within the looping structure above (in place of the “Prepare outgoing emails” comment above), we can now get our emails ready. This will utilize the email template and groups that we prepared earlier. Here is some sample code to get you started:
As you can see, we first use a template denoted by the constant $emailTemplatePattern for each recipient or customer to create a new email. Next, we expand the contact groups specified in the To and CC lines of the new email. Finally, we replace the tags that were denoted by “[tag]” in the template with appropriate data points meaningful to each recipient. This data is usually pulled directly off of the title or file name of the reports sent by SSRS. You could also parse information out of the attachments themselves, though such an activity is beyond the scope of this article.
Note: You can also have the script automatically send out your emails. I prefer to double check before they go out to make sure that everything looks ok.
Wrapping Up
Once everything is ready, you can either review and manually send out the resulting emails, or you can just sit back since PowerShell did it for you, depending on your choice above to Save or Send.
It is important to shut down any Outlook processes that were spawned during the script so as to maintain idempotency. Here is some code to do that:
Вы можете создать политики почтовых ящиков для применения параметров к пользователям в Outlook в Интернете (прежнее название — Outlook Web App) и новой Outlook для Windows. Outlook в Интернете почтовых ящиков полезны для применения и стандартизации параметров, например параметров вложений, для определенных групп пользователей.
Дополнительные сведения о политиках Outlook в Интернете почтовых ящиков см. в Outlook в Интернете почтовых ящиков.
Что нужно знать перед началом работы
Предполагаемое время для завершения каждой процедуры: 5 минут.
Для выполнения этой процедуры (процедур) необходимы соответствующие разрешения. Сведения о необходимых разрешениях см. в записи "Политики Outlook в Интернете почтовых ящиков" в разделе "Разрешения компонентов" Exchange Online статье.
Чтобы открыть центр Exchange администрирования (EAC), Exchange центре администрирования в Exchange Online. Сведения о том, как подключиться к Exchange Online PowerShell, см. в статье Подключение к Exchange Online PowerShell.
Сведения о сочетаниях клавиш, которые могут применяться к процедурам, описанным в этой статье, см. в разделе "Сочетания клавиш" Exchange центра администрирования.
Возникли проблемы? Обратитесь за помощью к участникам форумов Exchange. Посетите форумы на Exchange Online или Exchange Online Protection.
Используйте EAC для создания политики почтовых ящиков для Outlook в Интернете и нового Outlook для Windows
В EAC перейдите к Outlook Web App > разрешений и щелкните значок "
В открываемом окне политики настройте следующие параметры:
Имя политики. Укажите уникальное имя для политики.
Используйте флажки для включения или отключения компонентов. По умолчанию отображаются наиболее часто используемые компоненты. Чтобы открыть весь список компонентов, которые можно включить или выключить, выберите команду Дополнительные параметры.
Примечание. Параметры для отдельных пользователей можно настроить с помощью командлета Set-CASMailbox в Exchange Online PowerShell.
Следующий список содержит функции, которые можно настроить при создании политики почтовых ящиков с помощью EAC для Outlook в Интернете и нового Outlook для Windows:
Управление связью:
Управление информацией:
Безопасность.
- Изменение пароля: если этот параметр включен, пользователи могут изменить свои пароли, перейдя в Outlook в Интернете и новый Outlook для Windows.
Взаимодействие с пользователем:
Управление временем:
- Календарь: если этот параметр включен, пользователи могут использовать календарь в Outlook в Интернете и новый Outlook для Windows.
- Задачи: если этот параметр включен, пользователи могут использовать Outlook в Интернете и новый Outlook для Windows.
- Напоминания и уведомления: если этот параметр включен, пользователи будут получать новые уведомления по электронной почте, а также напоминания о задачах и календарях.
Укажите, как пользователи могут просматривать вложения с общедоступных или частных компьютеров и получать к ним доступ:
- Общедоступный или общий компьютер — прямой доступ к файлам. Если этот параметр включен, пользователи смогут открывать вложения, выбрав их и выбрав команду "Открыть".
- Частный компьютер или OWA для устройств — прямой доступ к файлам: если этот параметр включен, пользователи смогут открывать вложения, выбрав их и выбрав "Открыть".
Используйте Exchange Online PowerShell для создания политики почтовых ящиков для Outlook в Интернете и нового Outlook для Windows
В Exchange Online PowerShell создание политики почтовых ящиков для Outlook в Интернете и нового Outlook для Windows выполняется в два этапа:
Создайте политику, используя следующий синтаксис:
В этом примере создается политика почтовых ящиков для Outlook в Интернете и Outlook для Windows с именем "Руководители".
Подробные сведения о синтаксисе и параметрах см. в разделе New-OwaMailboxPolicy.
Измените параметры политики по умолчанию.
Как убедиться, что все получилось?
Чтобы убедиться, что вы успешно создали политику почтовых ящиков для Outlook в Интернете и новый Outlook для Windows:
- В Центре администрирования Exchange выберите пункты Разрешения >Политики Outlook Web App и найдите новую политику.
Чтобы убедиться, что вы успешно создали политику почтовых ящиков для Outlook в Интернете и Outlook для Windows, выполните одно из следующих действий:
В EAC щелкните "Outlook Web App > политики" и убедитесь, что политика указана. Вы можете выбрать политику и щелкнуть значок "Изменить для проверки свойств политики.
В Exchange Online PowerShell выполните следующую команду, чтобы убедиться, что политика указана в списке:
В Exchange Online PowerShell замените имя политики и выполните следующую команду, чтобы проверить параметры:
Дальнейшие действия
Сведения об изменении существующей Outlook в Интернете почтовых ящиков см. в статье Outlook в Интернете свойств политики почтовых ящиков в Exchange Online.
Have you ever needed to find an e-mail message from one or two years ago that, if you couldn’t find it, might adversely affect your circumstances? Does your company automatically delete messages from your Inbox or Sent Items folders? Do you get tired of copying e-mails to multiple folders when they touch on multiple topics of interest—a particular project, manager, subject matter, company division or the like?
Say an e-mail from Steve Masters comes in regarding the finances on Project X in Dubai. It would be useful to have an automated way to distribute copies of this message to folders for Project X, Steve Masters and Dubai, and ultimately to yet another folder for safekeeping. And all without you having to manually click around the Microsoft Outlook interface multiple times for each item of mail. (And if you receive a large volume of email, it’s all the more vital to automate some of the management tasks involved.)
The rules facility in Outlook is often useful in addressing these kinds of situations, and code I’ll present in this article shows how to automate the creation of rules. For example, copying messages from Steve Masters to a related folder in Outlook is a relatively straightforward matter. And that goes for other standard rules operations.
What’s more difficult to do, and generally outside the capacity of Outlook rules, is to get a single e-mail into multiple folders based on more amorphous criteria than standard rules contemplate. While Steve Masters's e-mail can easily be copied to a related folder, the other relevant factors in his message—that it concerns finance, Dubai and Project X, among other possible criteria—are much more difficult to translate into actions. The subject line might cover one or two of the criteria and be susceptible to formal manipulation by an Outlook rule, but that often places too much trust in any given sender's subject lines. What we need is a quick, automated method to assign values to e-mails in both your Inbox and Sent Items such that a PowerShell script can be run to allocate them to the correct folders.
Programming Outlook Rules
This section takes a stab at demonstrating programmatic creation of two Outlook rules. One rule reads a message’s subject line for the specific string “Notification” and then copies relevant messages to a specified folder (named Notifications).
With the namespace in hand, we specify the originating folder (the Inbox), create a new rule and specify the folder to copy to (Notifications).
Navigating Folders
It’s an interesting exercise to run some lines of code to see how folders are enumerated in the MAPI namespace. The following lines illustrate how to navigate to various levels of depth in the folder tree:
Having created a new rule instance, we can define its parameters and properties like this:
The first line relates the rule to the subject line of an incoming e-mail. The string to look for (“Completed Notification”) is specified, and the action to take is CopyToFolder (as opposed, for example, MoveToFolder). The invocation recites the action and the destination folder.
Figure 1 shows the second example of programmatically creating a rule, where we look at recipients rather than the subject line.
Figure 1. Creating a Rule for Recipients
Managing Messages with a Script
Clearly, one can do a lot in Outlook with the built-in rule facility, but what if you want to divide messages into categories like Project, Finance, Human Resources, Recipient Name, Sending Division, Month of Receipt, City, State, Country or any other of a virtually limitless number of categories, where any given e-mail could apply to multiple categories that are not identifiable from the subject or even the body of the message? In cases like these, a custom script can function like a special rule.
In the following example, we manage the Sent Items folder by manually marking the subject line of each message with acronyms ("\\\Admin,FOR", for example), where each acronym relates the message to a target folder (Administrative,Foreign in the example) to which the e-mail should be copied. The process calls for manual action only to mark the subject lines of sent items with your designated acronyms.
When the script runs, it finds the acronyms and copies the e-mail to as many folders as the acronyms listed in the subject line refer to. In addition, sent items are “aged” out of those folders by code that tests the respective received and sent dates for a given period and moves relevant messages to their respective resting places once the age criteria is met.
The function I wrote is called CopyMove-Email. It has three parameters: a list of acronyms or symbols, the corresponding list of folders and an integer representing the maximum number of days to retain a message under Sent Items before moving it to safekeeping. (For use with Inbox items—the code is not shown—a fourth parameter should be added to indicate the number of days to maintain an Inbox item.)
Then, as with the case of creating a rule, the messaging API is invoked:
If you look in Task Manager, you’ll see two instances of Outlook. One is the original, displayed version that you are working in, and the other is a background Outlook process being used by this script.
Next, we construct a timespan to mark the absolute limit for keeping sent items in that folder, whether the item is marked for copying or not.
Using the timespan, we create the dates against which to test each e-mail item in the Sent Items folder.
We also need a string-formatted date to use in naming text files that will store a specific day's run of this application. The text files will store, respectively, mail that was copied and mail that was moved.
Then we need to accumulate data about moves and copies in temporary holding arrays:
Experience shows that merely looping through all the messages in the Sent Items folder once isn’t enough; on a first loop, some items are handled but others aren’t touched. It may take three or four such loops to handle all the items that need handling. The number of loops probably depends on how many mail items are ready for copy-move operations and other factors in how Outlook interoperates with your computer. In any event, the solution is to use a Do-While structure to keep running the loop until all marked items have been properly managed.
The application is now ready to begin parsing through Sent Items:
The first If test is against the established maximum-days window and for the existence of either the \\\ tag or the /// tag:
With a matching e-mail in hand, test it for each acronym in the $acronyms parameter:
For each matching acronym, the script makes a copy of the subject e-mail and moves the copy to the folder that matches the acronym. This part of the code is shown in Figure 2. Essentially, this copies the message to the new folder while also leaving it in the original Sent Items folder.
Figure 2. Copying Code Based on Acronyms
The next action for these kinds of mail items (shown in Figure 3) is to move them to Sent Items OLD for more permanent storage and also for later transfer to a text file documenting the move-copy actions.
Figure 3. Moving Items to Sent Items OLD
Then messages in Sent Items that are past the maximum retention period should be moved to Sent Items OLD. Their data is also stored for moving into the related text file. (See Figure 4.)
Figure 4. Managing Message Retention Limits
The last action to take is moving data about moved and copied items into the text files set up to hold that data:
You can call the CopyMove function with parameters, including the list of acronyms and the list of related folder names, plus the maximum number of days to keep sent items in that folder before saving them to Sent Items OLD:
Wrapping Up
As an afterword, I’d note that scheduled tasks can be configured to include the code I’ve shown, but a certain number of gotchas will manifest themselves in the process, not least of which is that the task will not run if the machine is not connected to the network. So, remote users relying on a VPN, for example, might be out of luck if, as is usually the case, the connection automatically shuts down after a certain period of nonuse (like when you go to bed at night). Thus, the app can be scheduled to run only during times when you know the network connection is active.
Joe Leibowitz is an infrastructure consultant who specializes in Microsoft’s identity management products.
08.06.2021
itpro
Exchange, Office 365, PowerShell
Комментариев пока нет
В этой статье мы рассмотрим, как удаленно подключится к on-premises серверу Exchange или Office 365 (Exchange Online) из консоли PowerShell.
Удаленное подключение к Exchange из консоли PowerShell (без установки Exchange Management Tools)
Для управления on-premises Exchange (версии Exchange Server 2010, 2013, 2016 и 2019) используются командлеты из модуля Exchange Management Shell (устанавливается как часть Exchange management tools). Если у вас на компьютере не установлен модуль Exchange Management Shell, вы можете удаленно подключиться к серверу Exchange и импортировать командлеты с сервера в свою сессию локальную сессию PowerShell.
В Exchange Server удаленные подключения выполняются через отдельный виртуальный каталог IIS (Internet Information Services), который называется PowerShell. Для аутентфикации по-умолчанию используется Kerberos, а взаимодействие происходит через WinRM.
Совет. Обратите внимание, что некоторые командлеты EMS не поддерживаются полноценно через удаленную сессию PowerShell. Например, Get-ExchangeCertificate. Для его использования вам придется установить Exchange Management Shell на свой компьютер.
Прежде чем начать, убедитесь, что ваш локальный PowerShell разрешает запускать локальные PS скрипты (Execution Policy). Следующая команда разрешит запуск локальных скриптов для текущего пользователя.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Откройте на своем компьютере PowerShell консоль и выполните следующую команду:
Введите логин и пароль учетной записи, которую вы будете использовать для подключения к Exchange.
Создайте удаленную PowerShell сессию с вашим Exchange сервером:
Проверьте, что сессию создана и имеет State=Opened :
Импортируйте удаленную сессиюPowerShell в свою локальную:
Теперь вы сможете использовать все командлеты Exchange в своем локальном PowerShell сеансе.
Не забывайте корректно завершать удаленные PowerShell сессии. Если вы будете просто закрывать консоль Windows PowerShell без отключения сессии, вы можете исчерпать лимит сеансов удалённой среды PowerShell.
Для завершения сессии, выполните:
Проверьте, что запущенных сессий PowerShell не осталось:
Чтобы каждый раз при запуске консоли не выполнять командлеты импорта командлетов PowerShell с удаленного сервера, вы можете использовать профиль PowerShell.
Создайте файл профиля:
New-Item -Path $profile -ItemType file -force
Откройте созданный файл Microsoft.PowerShell_Profile.ps1 с помощью блокнота:
Добавьте в файл команды подключения к Exchange и импорта командлетов из удаленного сеанса в локальную сессию PowerShell:
Удаленное подключение к Exchange Online (Office 365) из Powershell
Похожим способом вы можете подключаться к своем тенанту Exchange Online (Office 365) для управления ящиками, переговорными комнатами, списками рассылки, и другими параметрами Office 365.
Рассмотрим, как удаленно подключится к Exchange Online из консоли PowerShell без установки модуля Microsoft Exchange Online PowerShell (EXO/ EXOv2) с помощью базовой аутентификации.
Сначала нужно разрешить запуск локальных скриптов:
Set-ExecutionPolicy RemoteSignedЗапросить имя и пароль учетной записи с правами администратора Exchange Online.
Для данного пользователя Azure должно быть предварительно разрешено удаленное подключение через PowerShell:
Теперь можно установить удаленную сессию PowerShell с Office 365:
Если для вашего аккаунта включена мультифакторная аутентификация (Multi-Factor Authentication -MFA рекомендуется Microsoft для всех аккаунтов администраторов), то при подключении через New-PSSession появится ошибка:
Для подключения к Exchange Online в этом случае используется командлет:
Либо можно отключить MFA для аккаунта:
Затем импортируйте удаленную сессию в свою консоль:
Максимально количество удаленных PowerShell подключений к организации Exchange Online ограничено тремя сессиями. При превышении появится ошибка:
Теперь вы можете управлять ящиками Office 365.
Чтобы закрыть всея удаленные PowerShell сессии, выполните:
Предыдущая статья Следующая статья
Управление группами рассылок в Exchange Server
Перенос почтовых ящиков Exchange в другую базу
Вывести все ящики, к которым есть доступ у определенного пользователя Exchange/Microsoft 365
11.12.2018
itpro
Exchange, PowerShell
комментариев 12
Клиентские и серверные правила Outlook
Администратору Exchange следует отличать правила Outlook, которые функционируют на стороне клиента (Client-side rules) и на стороне сервера (Server-side rules).
Просмотр правил в ящике Exchange
Чтобы вывести список правил в ящике Exchange, запустите консоль EMS и выполните следующую команду PowerShell:
Get-InboxRule –Mailbox abivanov
Как вы видите, для каждого правила выводится его имя, статус (Enabled: True/False), приоритет (Proirity) и RuleIdentity.
Можно вывести более подробную информацию о конкретном Inbox правиле, указав его имя:
Get-InboxRule -Mailbox abivanov -Identity "HelpDesk"| fl
Обычно содержание правила можно понять по полю Description:
Get-InboxRule -Mailbox abivanov -Identity "HelpDesk "| Select Name, Description | fl
Поиск правил в ящиках пользователей Exchange
В некоторых случаях администратору нужно найти определенные правила в ящике пользователя. Например, вам нужно найти все правила, в которых выполняется удаление писем:
Get-InboxRule -Mailbox abivanov | ?
Также может быть сценарий, когда по запросу службы информационной безопасности, вам нужно найти во всех ящиках организации правила автоматической пересылки почты:
foreach ($i in (Get-Mailbox -ResultSize unlimited)) < Get-InboxRule -Mailbox $i.DistinguishedName | where | fl MailboxOwnerID,Name,ForwardTo >> C:\PS\All_Mailbox_Forward_Rules.txt >
Создаем правило для входящей почты Outlook с помощью PowerShell
Создать новое правило Outlook для входящей почты можно с помощью командлета Exchange New-InboxRule. К примеру, вы хотите переслать все письма с определенными ключами в теме письма в другой ящик. Выполните команду:
New-InboxRule -Name ZenossAlerttoHelpdesk -Mailbox rootadmin -SubjectContainsWords "Zenoss Alert" -ForwardTo "Helpdesk"New-InboxRule -Mailbox abivanov –name SecretaryRule -From secretary@winitpro.ru –SubjectContainsWords “Годовое собрание" -ApplyCategory -MarkImportance 2
Для всех пользователей в определенном OU создадим правило, которое автоматически перемещает письма с темой «Казино» в каталог «Нежелательная почта» (Junk Email).
$mbxs = Get-mailbox -organizationalUnit Managers
$mbxs | % < >
$mbxs | %Список все доступных условий (Conditions), которые вы можете использовать в правилах Exchange можно вывести так:
Get-InboxRule -Mailbox abivanov | get-member
Чтобы изменить какое-то правило Outlook, нужно использовать командлет Set-InboxRule, например:
Set-InboxRule -Mailbox abivanov –identity SecretaryRule -FromAddressContainsWords
Совет. Размер правил в ящике Microsoft Exchange ограничен (см. статью). В Exchange 2003 размер правил ограничен 32 Кб, а в Exchange 2016/2013/2010 – под правила выделяется 64 кб. Если при редактировании правил появляется ошибка:
Некоторые правила невозможно загрузить в Microsoft Exchange, и они были отключены. Некоторые параметры не поддерживаются, или не хватает места для хранения всех ваших правил
Вы можете изменить размер квоты под правила (RulesQuota) до 256 Кб, выполнив команду:
Set-Mailbox -identity abivanov -RulesQuota 256Kb
Как отключить и удалить входящее правило Outlook из PowerShell
Чтобы отключить конкретное правило Outlook, нужно указать:
Disable-Inboxrule –Mailbox abivanov -Identity “SecretaryRule”
При этом его статус (Enabled) меняется False и оно более не применяется ко входящим письмам.
Чтобы удалить правило, выполните:
Remove-Inboxrule –Mailbox abivanov -Identity SecretaryRule
Команда запросит подтверждение, просто введите Y. Чтобы удалить все правила в определенном ящике, выполните:
Get-inboxrule -mailbox abivanov | disable-inboxrule
Предыдущая статья Следующая статья
Поиск и удаление писем в ящиках Exchange Server (Microsoft 365) с помощью PowerShell
Не работает поиск в Outlook: решение проблемы
Управление отключенными ящиками в Exchange
Ручная настройка подключения к Exchange в Outlook 2016
Спасибо ! Интересная тема.
Тема интересная.
Но еще интереснее обсудить настройку OoF на стороне почтового сервера, когда она настроена у клиента с пересылкой писем на другой почтовый ящик.
В Exchange 2013 такое правило (скрытое правило), можно увидеть, указав ключ -IncludeHidden.
А вот в Exchange 2010 такого ключа нет. И остаётся только Exchange Web Services (EWS) API. Вот про него очень не хватает статьи!Спс и Вас с наступающими!
По поводу EWS даже не знаю, очень уже непопулярная тематика… Один с таким объемом не справлюсь.Интересно, это у нас так криво настроили Exchange (подрядчики) или автор про такую фичу забыл упомянуть ? (;
Какая версия Exchnage? У пользователя уже были правила? Не может быть, что проблема связана с превышением лимита на размер правил?
Exch 2013, Outlook 2016.
У пользователя было только 2 правила. Шибко разбираться не стал, поверил спецам — те сказали, да есть такая фича у Exchange. И, вроде, ссылку давали на оффсайт — мельком глянул, удостоверился и забыл… Странно, что это малоизвестно… Может я все-таки что-то напутал, ок — если найду, то скину ссылку!
Собственно, искать и не пришлось — все есть в описаниях командлетов на оффсайте:
New-InboxRule
When you create, modify, remove, enable, or disable an Inbox rule in Exchange PowerShell, any client-side rules disabled by Microsoft Outlook and outbound rules are removed.
Set-InboxRule
The Set-InboxRule cmdlet allows you to modify the rule conditions, exceptions, and actions.
When you create, modify, remove, enable, or disable an Inbox rule in Exchange PowerShell, any client-side rules created by Microsoft Outlook are removed.
Или я все-таки что-то не так понимаю ??
При добавлении нового правила с помощью New-InboxRul уведомление появляется:
Confirm. Using Outlook Web App or Windows PowerShell to modify your rules will delete any rules that were previously turned off using Outlook. If you want to preserve the rules you turned off using Outlook, select «No» and use Outlook to edit your rules. Are you sure you want to proceed?
Cтарые правила не удалились несмотря на предупреждение. При этом не появилось и новое правило, лишь висит уведомление «Имеются не показанные правила, созданные в другой версии Outlook или OWA»…
New-InboxRule — показывает и старые и новые правило… Я в задумчивости…Да, такое было предупреждение, вроде…
Видимо, от настроек серверов зависит — у нас удаляются все client-side правила.
Я шибко разбираться не могу — доступ только к серверу баз данных. Да и то обрезанный.Подскажите, плз, а есть ли возможность узнать сколько занимает конкретное правило или суммарно все правила созданные пользователем в Outlook?
Читайте также: