Skip to content

New command: outlook mailbox settings set #6208

@MartinM85

Description

@MartinM85

Usage

m365 outlook mailbox settings set

Description

Update user mailbox settings

Options

Option Description
-i, --userId [userId] The ID of the Microsoft Entra user to update mailbox settings for. Specify either userId or userName, but not both. This option is required when using application permissions.
-n, --userName [userName] The UPN of the Microsoft Entra user to update mailbox settings for. Specify either userId or userName, but not both. This option 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 or IANA time zone identifier
--language [language] The preferred language for the user. Should follow ISO 639-1 Code. 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.
--workingHoursEndTime [workingHoursEndTime] The time of the day that the user stops working.
--workingHoursTimeZone [workingHoursTimeZone] The name of a time zone to which the working hours apply.
--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.
--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.
--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.

Examples

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

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

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

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

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

Default properties

No response

Additional Info

Requires MailboxSettings.ReadWrite permission.

The signed-in users can edit only theirs mailbox settings. It's not possible to read mailbox settings of another user with delegated permissions.

The options userId and userName should be specified only when the command is executed with application permissions.

https://learn.microsoft.com/en-us/graph/api/user-update-mailboxsettings?view=graph-rest-1.0&tabs=http

All those settings are under one Graph API endpoint, but if you think that it makes sense to split them up, we can have standalone commands for automatic replies and for working hours. It should make review and testing easier.

To read mailbox settings, users can use m365 aad user get --properties mailboxSettings

I will work on it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions