Hi,
Everyday we need to run the following command for new users
Set-Mailbox -identity <UserID> -DataEncryptionPolicy <Our Policy>
Is there a way Exchange Online can automatically apply this to all mailboxes?
Thanks!
Hi,
Everyday we need to run the following command for new users
Set-Mailbox -identity <UserID> -DataEncryptionPolicy <Our Policy>
Is there a way Exchange Online can automatically apply this to all mailboxes?
Thanks!
For Exchange on-premises, you could using Scripting Agent to do it. But this function doesn't exist on Exchange online.
Here may be an another way for your:
Use Windows schedule task to the scripting below to connect to Exchange online and set mailbox daily:
$User = "admin@domain.onmicrosoft.com"
$PassWord = ConvertTo-SecureString -String "Password" -AsPlainText -Force
$UserCredential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User, $PassWord
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
Get-Mailbox | where{$_.DataEncryptionPolicy -eq $null} | Set-Mailbox -DataEncryptionPolicy "11111"
About the using of schedule task, you could follow this blog: PowerShell Script
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
7 people are following this question.