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?

[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.

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
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
Challenges in Government Cyber Security

Has cyber security been a challenge in your government organization? Are you looking to improve your government's network security? Learn more about how to improve your government organization's security by viewing our on-demand webinar!

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
Ganesh Kumar ASr 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

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
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
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
Powershell

From novice to tech pro — start learning today.