Hello Experts,
I have come up with an requirement that says Microsoft 365 Mailboxes which is being connected by “Microsoft Entra” Source Connector type.
And to enable Office 365 mailboxes for all employee and non-employee users in scope via PowerShell commands in the Active Directory AfterCreate script
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://[url]/PowerShell/ -Authentication Kerberos
Import-PSSession $Session -DisableNameChecking
Enable-RemoteMailbox “$First $Last” -RemoteRoutingAddress $SamAccountName@[domain].mail.onmicrosoft.com -Alias “$SamAccountName”
I haven’t written an AfterCreate Rule till now, and I have gone through the documentation for writing the AfterCreate Rule but I’m not able to understand it.
Can anyone please provide me an sample rule and tell me were to place that powershell script, it would be really helpful.
Thank you