none
How to use Powershell to set delegate for user mailbox in Office 365?

    Question

  • Hello,

     

    Could you please tell me if I can use Powershell to set delegate for user mailbox in Office 365 or BPOS?

    If I can, then how can I do that (which Powershell command should I use?)?

     

    Many thanks and have a good day!

    Friday, February 04, 2011 3:20 PM

Answers

  • Sure, it is similar to Powershell in BPOS with some additional pieces:

    Use this command to set your credential variable:

    $cred = Get-Credential
    When you execute the above command, you'll be prompted for your Office 365 credentials. 

    Then create a new PowerShell Session object with this command:

    $s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection

    You'll get a warning about being redirected, don't worry that is what the -AllowRedirection command is for.

    Next, import the cmdlets to your local shell session:

    $importresults = Import-PSSession $s

    Once you are there you can run the Get-Command like this to see all the available commands, the one you'll need is probably 'Add-MailboxPermissions'

    Get-Command -Module $importresults | Out-Host -Paging

    Hope this helps!

     



    Jorge R. Diaz, PMP, CCNA, MCSA, MCSE


    Senior Microsoft Consultant

    Planet Technologies, Inc.

    Check out My Blog!

    Friday, February 04, 2011 3:39 PM

All replies

  • Sure, it is similar to Powershell in BPOS with some additional pieces:

    Use this command to set your credential variable:

    $cred = Get-Credential
    When you execute the above command, you'll be prompted for your Office 365 credentials. 

    Then create a new PowerShell Session object with this command:

    $s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection

    You'll get a warning about being redirected, don't worry that is what the -AllowRedirection command is for.

    Next, import the cmdlets to your local shell session:

    $importresults = Import-PSSession $s

    Once you are there you can run the Get-Command like this to see all the available commands, the one you'll need is probably 'Add-MailboxPermissions'

    Get-Command -Module $importresults | Out-Host -Paging

    Hope this helps!

     



    Jorge R. Diaz, PMP, CCNA, MCSA, MCSE


    Senior Microsoft Consultant

    Planet Technologies, Inc.

    Check out My Blog!

    Friday, February 04, 2011 3:39 PM
  • Many thanks! I will try that.

    Have a good day!

    Friday, February 04, 2011 3:54 PM
  • Hello,

     

    I'd like to set the permission on folder level, that's why I am using Add-MailboxFolderPermission to add the Editor permission for user A to access my Inbox folder. It did set the permission as Editor for user A to access my Inbox nicely. Thank you very much!

    However, user A didn't show up on my mailbox delegate list. (Though he was shown up in the Permission list for my Inbox as Editor)
    Do you know how can I make user A to show up on my mailbox delegate list using Powershell?

    Many thanks!

    Friday, February 04, 2011 4:33 PM
  • That I am not sure about...I did a little digging and keep getting thrown back to this blog, check it out and maybe it can help:

    http://gsexdev.blogspot.com/2009/04/add-delegates-to-mailbox-with.html

    Thanks,



    Jorge R. Diaz, PMP, CCNA, MCSA, MCSE


    Senior Microsoft Consultant

    Planet Technologies, Inc.

    Check out My Blog!

    Friday, February 04, 2011 5:55 PM
  • Many thanks, I will...
    Friday, February 04, 2011 7:14 PM
  • You know, I've checked the link, it requires to have local Exchange on my machine :(

     

    Anyway, many thanks for your help. If you happen to know how to set delegate for Office 365 using Powershell, or any tool, please let me know.

     

    Have a great day!

    Friday, February 04, 2011 8:08 PM
  • How about giving permissions to the mailbox?

    Add-MailboxPermission "MailboxYouWant2Delegate" -user PleaseUseUPN@company.com -Accessright FullAccess

    See this link for more details: http://technet.microsoft.com/en-us/library/bb676368.aspx#UseShell

    SendAs right needs to be set with "Add-AdPermission"

    Please make sure to use UPN instead of "Domain\Username"

    Regards,

    Tim

    Tuesday, February 08, 2011 7:59 AM
  • That is the command for giving full mailbox access rights, but the question at hand is can you just add permissions to view the Inbox if I am reading the post correctly.

    Jorge R. Diaz, PMP, CCNA, MCSA, MCSE, MCTS


    Senior Microsoft Consultant

    Planet Technologies, Inc.

    Check out My Blog!

    Wednesday, March 16, 2011 2:21 PM