> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/documentation/integrations/integration-guides/microsoft-cloud-integration-bundle/exchange-online-and-multi-property-values.md).

# Microsoft Exchange Online and multi-property values: PowerShell

Many people are familiar with the Exchange Online Management PowerShell module and how cmdlets or parameters are structured. There are some differences in how the module sends its commands and how the Exchange Admin API does them.

One key example is when people grant `send on behalf` permissions.

Here's an example of a PowerShell Command:

```powershell
/Set-Mailbox -Identity seanc@contoso.com -GrantSendOnBehalfTo pedro
```

This will set the `SendOnBehalf` permission for the mailbox `seanc` to be the user `pedro`. However, in some scenarios, it is necessary to grant multiple people access to the mailbox. Re-running the same command above will overwrite existing values, it is generally a better idea to pass it as a multi-property value.

Here's an example:

```powershell
Set-Mailbox -Identity "seanc@contoso.com" -GrantSendOnBehalfTo @{Add="pedro@contoso.com"}
```

This will append the new permission instead of overwriting it. Doing this in Rewst is a little bit different because the Exchange Admin API expects certain formatting in the request when it is sent to the API and you are providing a multi-value property.

### Steps to perform the same action in Rewst:

1. Add your `InvokeCommand` action to your workflow.
2. For the cmdlet set the value to: `Set-Mailbox.`
3. Add an Identity parameter with the target mailbox.
4. Add a `GrantSendOnBehalfTo` parameter and give it a value similar to\
   `(CTX.aad_user_id being the user that should get the perms)`:

```django
{{ {'@odata.type':'#Exchange.GenericHashTable','add': CTX.aad_user_id } }}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rewst.help/documentation/integrations/integration-guides/microsoft-cloud-integration-bundle/exchange-online-and-multi-property-values.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
