none
Providing the send as access rights for a user from powershell

    Question

  • Hi,

    I have requirement of providing grant right permissions for a mail box account using power shell script. Below was the code I am using

    $LiveCred = Get-Credential
     $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://xxxxxxxx/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
    Import-PSSession $Session

    Add-RecipientPermission "domainname\xxxxx" -AccessRights SendAs -Trustee "domainname\yyyyy"

    I am getting below error

    Add-RecipientPermission : The term 'Add-RecipientPermission' is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    Thanks in advance,

    Lakshman

    Tuesday, January 19, 2016 8:14 AM

All replies

  • Add-RecipientPermission is a cmdlet for office365, for on-premise versions Add-ADPermission
    Tuesday, January 19, 2016 8:17 AM
  • Add-RecipientPermission  is available only for Exchange Online. For on-prem, use Add-ADPermission: https://technet.microsoft.com/en-us/library/bb124403(v=exchg.160).aspx
    Tuesday, January 19, 2016 8:18 AM
  • I required for exchange online only
    Tuesday, January 19, 2016 8:47 AM
  • I required for exchange online only
    Tuesday, January 19, 2016 8:47 AM
  • Well for starters, connect to Exchange Online first: https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx

    Once connected, use the UPN or alias for the user, domain\xxxxx will NOT work. And make sure that you are a member of the "Mail Recipients" role in order to be able to run the cmdlets.

    Tuesday, January 19, 2016 9:51 AM
  •  Still I am getting the below issue

    Add-RecipientPermission : The term 'Add-RecipientPermission' is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    Tuesday, January 19, 2016 10:52 AM
  • Be sure to launch the Powershell Window by right-clicking and selecting “Run as administrator”.

    Tuesday, January 19, 2016 11:49 AM
  • Launch Windows PowerShell and perform the following steps::

    Import-Module msonline 
    $cred = Get-Credential 
    Connect-MsolService -cred $cred 
    Get-Command –Module msonline

    Follow details on this article.

    http://blogs.technet.com/b/catastrophic_failure_joannav/archive/2013/05/14/how-to-give-users-send-as-permission.aspx

    You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Recipient provisioning permissions" section in the Recipients Permissions topic.


    Regards,

    Satyajit

    Please“Vote As Helpful” if you find my contribution useful or “MarkAs Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.


    • Edited by Satyajit321 Tuesday, January 19, 2016 11:54 AM
    Tuesday, January 19, 2016 11:52 AM
  • No modules downloaded related to Add-RecipientPermission

    Tuesday, January 19, 2016 12:20 PM
  • Hi lakshaman,

    Thank you for your question.

    By this issue, we suggest you post this case by the following link:

    https://social.technet.microsoft.com/Forums/msonline/en-US/home?forum=onlineservicesexchange 

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding. 

    Best Regard,

    Jim Xu

    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Jim Xu
    TechNet Community Support

    Wednesday, January 20, 2016 1:38 AM
    Moderator