Jun 15 2020 02:14 AM
I want to use some Exchange cmdlets in Automation account, and I suppose I need to import a Exchange module for this - but I cannot find the correct module. Does anyone know?
I would like to use these two cmdlets in Automation account (Powershell runbook) to add an user to a group, and to give permission to shared mailbox:
Add-UnifiedGroupLinks (documentation at https://docs.microsoft.com/en-us/powershell/module/exchange/add-unifiedgrouplinks?view=exchange-ps)
Add-MailboxPermission (documentation at https://docs.microsoft.com/en-us/powershell/module/exchange/add-mailboxpermission?view=exchange-ps)
Something like this
Param (
[string] $Employee = ""
)
$credObject = Get-AutomationPSCredential -Name "O365servicekonto"
Connect-AzureAD -Credential $credObject
$User = Get-AzureADUser -ObjectId $Employee
Set-AzureADUser -ObjectId $User.ObjectId
Add-MailboxPermission <email of the shared mailbox> -User $Employee -AccessRights FullAccess -InheritanceType all