O'Reilly logo

PowerShell for Office 365 by Prashant G Bhoyar, Martin Machado

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

First requirement - limiting access to PowerShell commands

As we reviewed in a previous section, out-of-office settings are managed by just two commands:

Get-Command *MailboxAutoReply* | select NameName ---- Get-MailboxAutoReplyConfigurationSet-MailboxAutoReplyConfiguration

To limit access to just these commands, we need to identify a role that includes them as a starting point for our new role. To identify the role, we will search for role entries that include either of these commands. We rely on the Get-ManagementRoleEntry command with a wildcard to include all applicable entries. To keep the results simple, we used a unique filter, but we had to make sure both the Get and Set verbs are included.

Get-ManagementRoleEntry *\*MailboxAutoReplyConfiguration ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required