Das Feature “Connected Accounts” wurde offiziell 2018 von Microsoft eingestellt und kann seit dem im Webinterface nur mit großen Einschränkungen konfiguriert werden:
Dieses Feature bezieht sich auf das kostenlose E-Mail Angebot von Microsoft unter Outlook.com (Nachfolger von Hotmail, Live-Mail, …). Im kommerziellen Exchange Online existiert sowas IMHO gar nicht. Zudem wäre dort auch der Powershell Endpoint ein anderer!
Die Sync-Zeiten sind ziemlich hoch. MS macht hierzu leider keine Angabe (ist ja auch offiziell nicht supported. :P). Ich bin bisher nicht zum Messen gekommen. Bisherigen Erkenntnissen Nach liegen die Sync-Intervalle bei 15-30 Minuten. Für dringende E-Mails oder zeitlich ablaufende E-Mail-Inhalte (bspw. OTP-Tokens) also nicht geeignet. ;)
Zugangsdaten werden über ein Credential Object übergeben. Daher vorher separat erzeugen.
Wer 2FA für seinen Microsoft Account konfiguriert hat, benötigt hierfür das separat zu generierende App-Passwort. Option dazu befinden sich in den Account-Sicherheitseinstellungen direkt neben den 2FA Optionen.
PS C:\Users\your_username> $Cred = Get-Credential
PS C:\Users\your_username> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection PS C:\Users\your_username> Import-PSSession $Session ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 1.0 tmp_jqmzjlu4.1jt {Add-MailboxFolderPermission, Approve-ElevatedAccessReques...
Der Name von dem Modul wird automatisch generiert und variiert. Über das Modul lassen sich aber die interessanten Befehle finden:
PS C:\Users\your_username> Get-Command -Module tmp_jqmzjlu4.1jt CommandType Name Version Source ----------- ---- ------- ------ Function Add-MailboxFolderPermission 1.0 tmp_jqmzjlu4.1jt Function Approve-ElevatedAccessRequest 1.0 tmp_jqmzjlu4.1jt Function Clear-ActiveSyncDevice 1.0 tmp_jqmzjlu4.1jt Function Clear-MobileDevice 1.0 tmp_jqmzjlu4.1jt Function Deny-ElevatedAccessRequest 1.0 tmp_jqmzjlu4.1jt Function Disable-App 1.0 tmp_jqmzjlu4.1jt Function Disable-InboxRule 1.0 tmp_jqmzjlu4.1jt Function Disable-SweepRule 1.0 tmp_jqmzjlu4.1jt Function Enable-App 1.0 tmp_jqmzjlu4.1jt Function Enable-InboxRule 1.0 tmp_jqmzjlu4.1jt Function Enable-SweepRule 1.0 tmp_jqmzjlu4.1jt Function Get-ActiveSyncDevice 1.0 tmp_jqmzjlu4.1jt Function Get-ActiveSyncDeviceStatistics 1.0 tmp_jqmzjlu4.1jt Function Get-App 1.0 tmp_jqmzjlu4.1jt Function Get-CalendarProcessing 1.0 tmp_jqmzjlu4.1jt Function Get-CASMailbox 1.0 tmp_jqmzjlu4.1jt Function Get-Clutter 1.0 tmp_jqmzjlu4.1jt Function Get-ConsumerGroup 1.0 tmp_jqmzjlu4.1jt Function Get-ConsumerMailbox 1.0 tmp_jqmzjlu4.1jt Function Get-ElevatedAccessApprovalPolicy 1.0 tmp_jqmzjlu4.1jt Function Get-ElevatedAccessRequest 1.0 tmp_jqmzjlu4.1jt Function Get-EventsFromEmailConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-InboxRule 1.0 tmp_jqmzjlu4.1jt Function Get-Mailbox 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxAutoReplyConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxCalendarConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxCalendarFolder 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxFolder 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxFolderPermission 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxJunkEmailConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxMessageConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxOverrideConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxPreferredLocation 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxRegionalConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxSpellingConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxStatistics 1.0 tmp_jqmzjlu4.1jt Function Get-MailboxUserConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-MessageCategory 1.0 tmp_jqmzjlu4.1jt Function Get-MessageClassification 1.0 tmp_jqmzjlu4.1jt Function Get-MobileDevice 1.0 tmp_jqmzjlu4.1jt Function Get-MobileDeviceStatistics 1.0 tmp_jqmzjlu4.1jt Function Get-OnlineMeetingConfiguration 1.0 tmp_jqmzjlu4.1jt Function Get-RbacDiagnosticInfo 1.0 tmp_jqmzjlu4.1jt Function Get-Recipient 1.0 tmp_jqmzjlu4.1jt Function Get-ReportSubmissionPolicy 1.0 tmp_jqmzjlu4.1jt Function Get-RetentionPolicy 1.0 tmp_jqmzjlu4.1jt Function Get-RetentionPolicyTag 1.0 tmp_jqmzjlu4.1jt Function Get-SenderPermission 1.0 tmp_jqmzjlu4.1jt Function Get-SweepRule 1.0 tmp_jqmzjlu4.1jt Function Get-SyncRequest 1.0 tmp_jqmzjlu4.1jt Function Get-SyncRequestStatistics 1.0 tmp_jqmzjlu4.1jt Function Get-UnifiedAuditSetting 1.0 tmp_jqmzjlu4.1jt Function Get-User 1.0 tmp_jqmzjlu4.1jt Function Get-UserPhoto 1.0 tmp_jqmzjlu4.1jt Function Import-RecipientDataProperty 1.0 tmp_jqmzjlu4.1jt Function New-App 1.0 tmp_jqmzjlu4.1jt Function New-ConsumerGroup 1.0 tmp_jqmzjlu4.1jt Function New-ElevatedAccessRequest 1.0 tmp_jqmzjlu4.1jt Function New-InboxRule 1.0 tmp_jqmzjlu4.1jt Function New-MailboxFolder 1.0 tmp_jqmzjlu4.1jt Function New-MailMessage 1.0 tmp_jqmzjlu4.1jt Function New-PrivilegedIdentityManagementRequest 1.0 tmp_jqmzjlu4.1jt Function New-SweepRule 1.0 tmp_jqmzjlu4.1jt Function New-SyncRequest 1.0 tmp_jqmzjlu4.1jt Function Remove-ActiveSyncDevice 1.0 tmp_jqmzjlu4.1jt Function Remove-App 1.0 tmp_jqmzjlu4.1jt Function Remove-InboxRule 1.0 tmp_jqmzjlu4.1jt Function Remove-MailboxFolderPermission 1.0 tmp_jqmzjlu4.1jt Function Remove-MailboxUserConfiguration 1.0 tmp_jqmzjlu4.1jt Function Remove-MobileDevice 1.0 tmp_jqmzjlu4.1jt Function Remove-SweepRule 1.0 tmp_jqmzjlu4.1jt Function Remove-SyncRequest 1.0 tmp_jqmzjlu4.1jt Function Remove-UserPhoto 1.0 tmp_jqmzjlu4.1jt Function Reset-EventsFromEmailBlockStatus 1.0 tmp_jqmzjlu4.1jt Function Resume-SyncRequest 1.0 tmp_jqmzjlu4.1jt Function Revoke-ElevatedAccessAuthorization 1.0 tmp_jqmzjlu4.1jt Function Set-CalendarProcessing 1.0 tmp_jqmzjlu4.1jt Function Set-CASMailbox 1.0 tmp_jqmzjlu4.1jt Function Set-Clutter 1.0 tmp_jqmzjlu4.1jt Function Set-ConsumerGroup 1.0 tmp_jqmzjlu4.1jt Function Set-ConsumerMailbox 1.0 tmp_jqmzjlu4.1jt Function Set-ElevatedAccessRequest 1.0 tmp_jqmzjlu4.1jt Function Set-EventsFromEmailConfiguration 1.0 tmp_jqmzjlu4.1jt Function Set-InboxRule 1.0 tmp_jqmzjlu4.1jt Function Set-Mailbox 1.0 tmp_jqmzjlu4.1jt Function Set-MailboxAutoReplyConfiguration 1.0 tmp_jqmzjlu4.1jt Function Set-MailboxCalendarConfiguration 1.0 tmp_jqmzjlu4.1jt Function Set-MailboxCalendarFolder 1.0 tmp_jqmzjlu4.1jt Function Set-MailboxFolderPermission 1.0 tmp_jqmzjlu4.1jt Function Set-MailboxJunkEmailConfiguration 1.0 tmp_jqmzjlu4.1jt Function Set-MailboxMessageConfiguration 1.0 tmp_jqmzjlu4.1jt Function Set-MailboxRegionalConfiguration 1.0 tmp_jqmzjlu4.1jt Function Set-MailboxSpellingConfiguration 1.0 tmp_jqmzjlu4.1jt Function Set-MailUser 1.0 tmp_jqmzjlu4.1jt Function Set-RetentionPolicyTag 1.0 tmp_jqmzjlu4.1jt Function Set-SweepRule 1.0 tmp_jqmzjlu4.1jt Function Set-SyncRequest 1.0 tmp_jqmzjlu4.1jt Function Set-UnifiedAuditSetting 1.0 tmp_jqmzjlu4.1jt Function Set-User 1.0 tmp_jqmzjlu4.1jt Function Set-UserPhoto 1.0 tmp_jqmzjlu4.1jt Function Start-AuditAssistant 1.0 tmp_jqmzjlu4.1jt Function Suspend-SyncRequest 1.0 tmp_jqmzjlu4.1jt Function Test-DatabaseEvent 1.0 tmp_jqmzjlu4.1jt Function Test-MailboxAssistant 1.0 tmp_jqmzjlu4.1jt
Uns interessieren vorallem:
In diesem Beispiel mit einer POP3 Verbindung zu GMX. Geht natürlich auch mit anderen. ;)
# Passwort in SecureString konvertieren PS C:\Users\your_username> $pw = (ConvertTo-SecureString -string "<mein_tolles_passwort>" -AsPlainText -force) # Connected Account anlegen PS C:\Users\your_username> New-SyncRequest -Name "<mein_toller_alias>@gmx.net" -RemoteEmailAddress "<mein_toller_alias>@gmx.net" -Password $pw -Pop -RemoteServerPort 995 -RemoteServerName pop.gmx.net -DoNotLeaveOnServer -Security ssl RunspaceId : 00000000-0000-0000-0000-000000000000 Mailbox : EURP000.PROD.OUTLOOK.COM/Microsoft Exchange Hosted Organizations/sct-00-00-0000-00-msonline-outlook-00000.templateTenant/puid-0000000000000000 EmailAddress : <mein_toller_alias>@gmx.net SyncProtocol : Pop RemoteServerName : pop.gmx.net RemoteServerPort : 995 SmtpServerName : SmtpServerPort : 0 AuthenticationMethod : Basic SecurityMechanism : Ssl AcceptUntrustedCertificates : False DisplayName : OAuthProvider : None LastSuccessfulSyncTimestamp : LastUpdateTimestamp : 04.12.2022 12:52:59 LastFailureTimestamp : InitialSyncCompletionTimestamp : FailureType : TargetRootFolder : InternalFlags : SkipKnownCorruptions,DoNotLeaveOnServer,UseDataConsistencyScore,UseFailureHistoryHandler DoNotLeaveOnServer : True RemoteSendEnabled : False IsQuarantined : False IsOauthSync : False UserName : <mein_toller_alias>@gmx.net SmtpUserName : Name : <mein_toller_alias>@gmx.net RequestGuid : 00000000-0000-0000-0000-000000000000 RequestQueue : EURP000DG000-db000 ExchangeGuid : 00000000-0000-0000-0000-000000000000 Flags : CrossOrg, Pull WorkloadType : SyncAggregation BatchName : Status : Queued Protect : False Suspend : False Direction : Pull RequestStyle : CrossOrg OrganizationId : EURP000.PROD.OUTLOOK.COM/Microsoft Exchange Hosted Organizations/sct-00-00-0000-00-msonline-outlook-00000.templateTenant - EURP000.PROD.OUTLOOK.COM/ConfigurationUnits/sct-00-00-0000-00-msonline-outlook-00000.templateTenant/Configuration SourceMailboxSize : 0 MailboxRopCount : WhenChanged : 04.12.2022 13:52:59 WhenCreated : 04.12.2022 13:52:59 WhenChangedUTC : 04.12.2022 12:52:59 WhenCreatedUTC : 04.12.2022 12:52:59 Identity : EURP000.PROD.OUTLOOK.COM/Microsoft Exchange Hosted Organizations/sct-00-00-0000-00-msonline-outlook-00000.templateTenant/puid-0000000000000000\<mein_toller_alias>@gmx.net IsValid : True ObjectState : New