Setup calendar

Hi expert

Currently HR Emily like to have full control all users calendar but due to restrictions in O365 , I can’t provide her Admin.

I believe powershell able to achieve this, how to do it on powershell to provide Emily full control of the calendar that she able to view, edit of all users calendar?

Thanks
alanlam123Asked:
Who is Participating?
 
Ganesh Kumar AConnect With a Mentor Sr Infrastructure SpecialistCommented:
Add all the users to CSV file and save as users.csv file having alias as the column heading in the CSV file.

Assuming username is Emily and provide permission for all the users in the CSV to grant permission as reviewer:
Import-Csv users.csv | foreach { add-MailboxFolderPermission -Identity "Emily:\calendar" -User $_.alias -AccessRights Reviewer }
0
 
Ganesh Kumar ASr Infrastructure SpecialistCommented:
First you can connect using powershell to office 365 by using following commands:
Note: You should have full administrator permission to run the command.

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUrihttps://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

To view the existing permission run the following command:
Get-MailboxFolderPermission username:\calendar

For giving Editor permission
Add-MailboxFolderPermission -Identity user1@domain.com:\calendar -user user2@domain.com -AccessRights Editor

Reviewer permission
Set-MailboxFolderPermission -Identity user1@domain.com:\calendar -User Default -AccessRights Reviewer

To Remove permission:
Remove-MailboxFolderPermission -Identity user1@domain.com:\calendar –user user2@domain.com

To close the session :
Remove-PSSession $Session
0
 
alanlam123Author Commented:
Thanks for the response

How to setup for 40 users, I assume it will better way.
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
Ganesh Kumar ASr Infrastructure SpecialistCommented:
If the permission is required for all he 40 users in single database then you can use below command and access rights you can give as per your requirement.

Get-Mailbox –database mbxdbname | ForEach-Object {Set-MailboxFolderPermission $_”:\calendar” -User Default -AccessRights Reviewer}

From CSV file :
Import-Csv users.csv | foreach { add-MailboxFolderPermission -Identity "user1@domain.com:\calendar" -User $_.alias -AccessRights owner }
0
 
alanlam123Author Commented:
Thanks for response

How to allow Emily as a HR able to have full control of calendar and share her calendars to All staff. And All staff just able to view only.
0
 
alanlam123Author Commented:
thanks for the support i have tried the powershell script but it was prompting a connection url  value .

what is the conenction url value?
Capture-for-powershell-issue--exchna.PNG
0
 
alanlam123Author Commented:
please note i have apply the first line is :

$LiveCred = Get-Credential

After enter the Cred and password

I am entered the second line: $Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUrihttps://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

third command should be: Import-PSSession $Session
0
 
alanlam123Author Commented:
i try this command too :

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell-liveid?DelegatedOrg=<customer tenant domain name>-Credential $UserCredential -Authentication Basic -AllowRedirection
0
 
alanlam123Author Commented:
Hi all

I have managed to assign the permission to HR,

How to assign it to the group, i was having issue when i try to assign it Allstaff_sg@zuji.com
show in the following screenshot.
Capture-for-mailbox-settng-for-calen.PNG
0
 
Ganesh Kumar ASr Infrastructure SpecialistCommented:
It is because the mail id is incorrect or you do not have permission for that mailbox. Please check.
0
 
alanlam123Author Commented:
Thanks for response.

I am the owner of the mail id and email id was correct.
0
 
Ganesh Kumar ASr Infrastructure SpecialistCommented:
When a group does not have mailbox how you will assign the permission? Is the group is security group? Can you try from GUI to provide permission, have full permission for the calendar. Add the shared calendar in outlook, right click and click properties and go to the permission tab and add the security DL and assign appropriate permission.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.