Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: outlook mailbox settings set #6208

Open
MartinM85 opened this issue Aug 2, 2024 · 6 comments · May be fixed by #6550
Open

New command: outlook mailbox settings set #6208

MartinM85 opened this issue Aug 2, 2024 · 6 comments · May be fixed by #6550

Comments

@MartinM85
Copy link
Contributor

MartinM85 commented Aug 2, 2024

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 john.doe@contoso.com --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.

@milanholemans milanholemans added needs peer review Needs second pair of eyes to review the spec or PR feature request labels Aug 3, 2024
@MartinM85
Copy link
Contributor Author

@pnp/cli-for-microsoft-365-maintainers Will you have time to review this?

@milanholemans
Copy link
Contributor

milanholemans commented Dec 31, 2024

Few remarks:

  • for language, we could rephrase it a bit as we do for entra user add
  • For dateFormat and timeFormat. Could we provide an example in the description? Or add a site URL with allowed values?
  • For timeZone, let's add a URL to a site with all possible time zones.
  • Could we rename workingHoursDaysOfWeek to workingDaysOfWeek or workingDays? I feel like the hours only adds confusion to the name.

It's not possible to read mailbox settings of another user with delegated permissions.

Does this apply to Exchange Online admins as well?

Maybe separate commands would be more clear, on the other side, this is a settings set command. We know they can become bulky. Any second opinion @pnp/cli-for-microsoft-365-maintainers?

@MartinM85
Copy link
Contributor Author

@milanholemans Even Exchange admins or Global admins can't read other users' mailbox settings

@milanholemans
Copy link
Contributor

Ok then, if you've applied the remarks, for me it looks ok to implement.

@Adam-it Adam-it added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Jan 2, 2025
@MartinM85
Copy link
Contributor Author

I will take it

@Adam-it
Copy link
Member

Adam-it commented Jan 3, 2025

I will take it

All yours 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants