what is the power shell to give someone owner rights to calendar and tasks

im tired of going to boss1 calendar and tasks in outlook and give user1 owner rights to tasks and calendar. how can i do it through powershell.?

thanks
ttrbrtsnAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will SzymkowskiSenior Solution ArchitectCommented:
You can use the below command to accomplish this.

Adding Permissions to Calendar
Add-MailboxFolderPermission -Identity user1@domain.com:\Calendar -User User2@domain.com -AccessRights Owner

Open in new window


Adding Permissions to Tasks
Add-MailboxFolderPermission -Identity user1@domain.com:\Tasks -User User2@domain.com -AccessRights Owner

Open in new window


Will.
ttrbrtsnAuthor Commented:
user1 is the calendar that is being shared out?
user2 is who is getting the owner rights to user1 calendar ans tasks?
Will SzymkowskiSenior Solution ArchitectCommented:
Exactly correct!

Will.
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

David Johnson, CD, MVPOwnerCommented:
to expand Will's Answer
<#
.Synopsis
   Gives a user full permission on another users calendar
.Description
    This script will give a user full permission on another users exchange calendar
.EXAMPLE
Give-CalendarPermision -CalendarOwner abc@domain.com -user def@domain.com
.Link
http://www.experts-exchange.com/questions/28694426/what-is-the-power-shell-to-give-someone-owner-rights-to-calendar-and-tasks.html
https://technet.microsoft.com/en-us/library/ee617241.aspx
https://technet.microsoft.com/en-us/library/aa998225%28v=exchg.150%29.aspx

.Notes

Adds functionality to original script designed by Will Szymkowski
#>
function Give-CalendarPermision
{
    [CmdletBinding()]
    [Alias()]
    [OutputType([int])]
    Param
    (
        # The Calendar Owners username
        [Parameter(ValueFromPipelineByPropertyName=$true,
                   Position=0)]
        $CalendarOwner,
        # The User to give permissions to.
        $User
    )

#check for paremeters existing and get values if not there

   if ($CalendarOwner -eq $null){
    $CalendarOwner = Read-host "Calendar to Share user@domain.com"
    }
    if ($user -eq $null){
    $user2 = Read-Host "User to Give Access To user@domain.com"
    }
    $identity = $CalendarOwner + ":\\Tasks"
#check if the mailbox exists
    if ((get-Mailbox -identity $CalendarOwner) -eq $null){
    Write-Output ("Mailbox:" + $CalendarOwner + " doesn't exist")
    break
    }
#check if user exists
if ((get-aduser -Filter [(samaccountname -eq $user)]) -eq $null) {
Write-Output ("Username:" + $User + " doesn't exist")
    break
}
$identity = $CalendarOwner + ":\\Tasks"
Add-MailboxFolderPermission -Identity $identity -User $user -AccessRights Owner
}  

Open in new window

ttrbrtsnAuthor Commented:
what does this script to and what extension should i save it as?
ttrbrtsnAuthor Commented:
i ran the following cmdlet

Add-MailboxFolderPermission -Identity user1@domain.com:\Calendar -User User2@domain.com -AccessRights Owner

i got an error saying that the "An existing permission entry was found for user:"

when i went onto outlook for the user and checked out her rights, she had reviewer rights, not owner rights.

why would i get this error?


thanks
Will SzymkowskiSenior Solution ArchitectCommented:
This is the catch here. If a user already has mailbox permissions on a specific mailbox and you want to CHANGE the permissions from reviewer to say owner, then you need to use set-mailboxfolderpermissions.

Add-MailboxFolderPermission adds permissions that do not already exist

Set-MailboxFolderPermission modifies and existing permission against the mailbox. So in your case changing Reviewer to Owner. You would use the Set-MailboxFolderPermission.

Will.
ttrbrtsnAuthor Commented:
since rights have been given to the aclendar already, even though its the worng rights, if i want to change any rights, i need to changed the cmdlet to:

Set-MailboxFolderPermission instead of Add-MailboxFolderPermission

?
Will SzymkowskiSenior Solution ArchitectCommented:
since rights have been given to the aclendar already, even though its the worng rights, if i want to change any rights, i need to changed the cmdlet to:

 Set-MailboxFolderPermission instead of Add-MailboxFolderPermission

 ?

That is correct.

Will.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ttrbrtsnAuthor Commented:
good answer and very patient with me
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.