Skip to content

LDAP style sync for O365 mailboxes with 3rd party service

Notifications You must be signed in to change notification settings

AlexMaunder/O365_user_sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

O365 usersync & connector setup

LDAP style sync for O365 mailboxes with 3rd party filter. Also sets up required inbound and outbound connectors.

To automate the connector initial setup, integrate the lockdown rules with below Powershell code:

params given by python script calling this ps1 script

param( [string]$arg1, [string]$arg2 )

allows ps to be run without needing to be signed - 1 time call that needs to be run to update server settings

Set-ExecutionPolicy Unrestricted

Set-ExecutionPolicy RemoteSigned

$User = $arg2 ### '[email protected]' ### $arg2 $PWord = ConvertTo-SecureString -String $arg1 -AsPlainText -Force ### "XXXXX" ### $arg1

$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord

Exchange Online

Write-Output $arg1

Write-Output $User

$User, $PWord

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential ${Credential} -Authentication Basic -AllowRedirection Import-PSSession $Session –AllowClobber

inbound mailflow lockdown rule

New-TransportRule "Filter lockdown" -RejectMessageReasonText "Email bypassed MX records" -RejectMessageEnhancedStatusCode "5.7.1" -ExceptIfMessageTypeMatches Calendaring -ExceptIfSenderIpRanges '1.1.1.1/32', '2.2.2.2/20', '3.3.3.3/24' -ExceptIfFromScope InOrganization

outbound lockdown rule

New-OutboundConnector "Filter Outbound" -RecipientDomains * -UseMXRecord $false -SmartHosts "outbound.address.com" -TlsSettings EncryptionOnly

validate outbound lockdown rule

Validate-OutboundConnector -Identity "Filter Outbound" -Recipients [email protected]

Get-Mailbox

Get-TransportRule

To clear session: Get-PSSession | Remove-PSSession

Get-OutboundConnector

Validate-OutboundConnector

To close sessions: Get-PSSession Remove-PSSession $sessionname

Get-PSSession

Remove-PSSession -Id 1

About

LDAP style sync for O365 mailboxes with 3rd party service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published