Skip to content

Commit

Permalink
Adds command 'outlook mailbox settings set'. Closes #6208
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinM85 authored and martinlingstuyl committed Jan 15, 2025
1 parent 60298b1 commit bdaf6d9
Show file tree
Hide file tree
Showing 7 changed files with 1,021 additions and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const dictionary = [
'log',
'login',
'logout',
'mailbox',
'management',
'member',
'membership',
Expand Down
166 changes: 166 additions & 0 deletions docs/docs/cmd/outlook/mailbox/mailbox-settings-set.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# outlook mailbox settings set

Updates user mailbox settings

## Usage

```sh
m365 outlook mailbox settings set [options]
```

## Options

```md definition-list
`-i, --userId [userId]`
: The ID of the Microsoft Entra user to update mailbox settings for. Either `userId` or `userName` is required when using application permissions.

`-n, --userName [userName]`
: The UPN of the Microsoft Entra user to update mailbox settings for. Either `userId` or `userName` is required when using application permissions.

`--dateFormat [dateFormat]`
: The date format for the user's mailbox. Example: `dd.MM.yyyy`.

`--timeFormat [timeFormat]`
: The time format for the user's mailbox. Example: `H:mm`.

`--timeZone [timeZone]`
: The default time zone for the user's mailbox. Should follow [Windows time zone name](https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11#time-zones) or [IANA time zone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). Example: `Central Europe Standard Time`.

`--language [language]`
: The preferred language for the user. Should follow [ISO 639-1 Code](https://learn.microsoft.com/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a). Example: `en-US`.

`--delegateMeetingMessageDeliveryOptions [delegateMeetingMessageDeliveryOptions]`
: Specifies who can receive meeting messages and meeting responses. Allowed values are `sendToDelegateOnly`, `sendToDelegateAndPrincipal`, or `sendToDelegateAndInformationToPrincipal`.

`--workingDays [workingDays]`
: The days of the week on which the user works, separated by a comma. Allowed values are `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, or `sunday`.

`--workingHoursStartTime [workingHoursStartTime]`
: The time of the day that the user starts working. Example: `09:00`.

`--workingHoursEndTime [workingHoursEndTime]`
: The time of the day that the user stops working. Example: `17:00`.

`--workingHoursTimeZone [workingHoursTimeZone]`
: The name of a time zone to which the working hours apply. Should follow [Windows time zone name](https://learn.microsoft.com/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11#time-zones) or [IANA time zone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). Example: `Central Europe Standard Time`.

`--autoReplyExternalAudience [autoReplyExternalAudience]`
: Specifies external audience who will receive reply message. Allowed values are `none`, `contactsOnly`, or `all`.

`--autoReplyExternalMessage [autoReplyExternalMessage]`
: The reply message for the external audience.

`--autoReplyInternalMessage [autoReplyInternalMessage]`
: The reply message for the audience from the signed-in user's organization.

`--autoReplyStartDateTime [autoReplyStartDateTime]`
: The date and time that automatic replies are set to begin. Example: `2025-01-06T11:00:00.0000000`.

`--autoReplyStartTimeZone [autoReplyStartTimeZone]`
: The time zone that automatic replies are set to begin.

`--autoReplyEndDateTime [autoReplyEndDateTime]`
: The date and time that automatic replies are set to end. Example: `2025-01-07T11:00:00.0000000`.

`--autoReplyEndTimeZone [autoReplyEndTimeZone]`
: The time zone that automatic replies are set to end.

`--autoReplyStatus [autoReplyStatus]`
: The status for automatic replies. Allowed values are `disabled`, `alwaysEnabled`, or `scheduled`.
```

<Global />

## Examples

Update date, time format and time zone of the signed-in user.

```sh
m365 outlook mailbox settings set --dateFormat 'dd.MM.yyyy' --timeFormat 'H:mm' --timeZone 'Central Europe Standard Time' --language 'en-US'
```

Update working hours of a user specified by id

```sh
m365 outlook mailbox settings set --userId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --workingDays 'monday,tuesday,thursday,friday' --workingHoursStartTime '08:00' --workingHoursEndTime '16:30' --workingHoursTimeZone 'Central Europe Standard Time'
```

Set scheduled automatic replies for the internal audience of a user specified by UPN

```sh
m365 outlook mailbox settings set --userName [email protected] --autoReplyExternalAudience none --autoReplyInternalMessage 'On vacation' --autoReplyStartDateTime '2024-08-05T08:00:00.0000000' --autoReplyStartTimeZone 'Central Europe Standard Time' --autoReplyEndDateTime '2024-08-09T16:00:00.0000000' --autoReplyEndTimeZone 'Central Europe Standard Time' --autoReplyStatus scheduled
```

## Response

The command returns the updated properties of the user mailbox settings.

<Tabs>
<TabItem value="JSON">

```json
{
"timeZone": "Central Europe Standard Time",
"timeFormat": "H:mm",
"dateFormat": "dd.MM.yyyy",
"language": {
"locale": "en-US",
"displayName": "English (United States)"
},
"workingHours": {
"daysOfWeek": [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday"
],
"startTime": "08:00:00.0000000",
"endTime": "16:30:00.0000000",
"timeZone": {
"name": "Central Europe Standard Time"
}
}
}
```

</TabItem>
<TabItem value="Text">

```text
dateFormat : dd.MM.yyyy
language : {"locale":"en-US","displayName":"English (United States)"}
timeFormat : H:mm
timeZone : Central Europe Standard Time
workingHours: {"daysOfWeek":["monday","tuesday","wednesday","thursday","friday"],"startTime":"08:00:00.0000000","endTime":"16:30:00.0000000","timeZone":{"name":"Central Europe Standard Time"}}
```

</TabItem>
<TabItem value="CSV">

```csv
dateFormat,timeZone,timeFormat
dd.MM.yyy,Central Europe Standard Time,H:mm
```

</TabItem>
<TabItem value="Markdown">

```md
# outlook mailbox settings set --dateFormat "dd.MM.yyyy" --timeFormat "H:mm" --timeZone "Central Europe Standard Time" --language "en-US" --workingDays "monday,tuesday,wednesday,thursday,friday" --workingHoursStartTime "08:00:00.0000000" --workingHoursEndTime "16:30:00.0000000" --workingHoursTimeZone "Central Europe Standard Time"

Date: 1/6/2025

Property | Value
---------|-------
dateFormat | dd.MM.yyyy
timeZone | Central Europe Standard Time
timeFormat | H:mm
```

</TabItem>
</Tabs>
9 changes: 9 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,15 @@ const sidebars: SidebarsConfig = {
}
]
},
{
mailbox: [
{
type: 'doc',
label: 'mailbox settings set',
id: 'cmd/outlook/mailbox/mailbox-settings-set'
}
]
},
{
message: [
{
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
'https://graph.microsoft.com/Mail.Read.Shared',
'https://graph.microsoft.com/Mail.ReadWrite',
'https://graph.microsoft.com/Mail.Send',
'https://graph.microsoft.com/MailboxSettings.ReadWrite',
'https://graph.microsoft.com/Notes.ReadWrite.All',
'https://graph.microsoft.com/OnlineMeetingArtifact.Read.All',
'https://graph.microsoft.com/OnlineMeetings.ReadWrite',
Expand Down
1 change: 1 addition & 0 deletions src/m365/outlook/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const prefix: string = 'outlook';

export default {
MAIL_SEND: `${prefix} mail send`,
MAILBOX_SETTINGS_SET: `${prefix} mailbox settings set`,
MESSAGE_GET: `${prefix} message get`,
MESSAGE_LIST: `${prefix} message list`,
MESSAGE_MOVE: `${prefix} message move`,
Expand Down
Loading

0 comments on commit bdaf6d9

Please sign in to comment.