{"id":16,"date":"2023-03-19T07:36:04","date_gmt":"2023-03-19T06:36:04","guid":{"rendered":"http:\/\/10.4.44.99:10084\/?p=16"},"modified":"2023-03-19T07:36:04","modified_gmt":"2023-03-19T06:36:04","slug":"microsoft-exchange-scripting-agent-kalender","status":"publish","type":"post","link":"https:\/\/www.winni.at\/wordpress\/?p=16","title":{"rendered":"Microsoft Exchange Scripting Agent Kalender"},"content":{"rendered":"\n<p>Below an example of my Exchange Scripting Agent.<\/p>\n\n\n\n<p>With this configuration you can set various parameters after mailbox creation. I\u00b4ve tested various examples but this works great for me with an Microsoft Exchange Server 2016.<\/p>\n\n\n\n<p><strong>Step 1: Exchange Scripting Agent enabling<\/strong>&nbsp;&#8211;&gt; Open Exchange Management Shell:<\/p>\n\n\n\n<p><code>Enable-CmdletExtensionAgent&nbsp;\"Scripting Agent\"<\/code><\/p>\n\n\n\n<p><strong>Step 2: Create Exchange Scripting Configuration<\/strong><\/p>\n\n\n\n<p>On exchange program directory \\Bin\\CmdletExtensionAgents create a file named ScriptingAgentConfig.xml<\/p>\n\n\n\n<p>Example:&nbsp;<code>C:\\Program Files\\Microsoft\\Exchange Server\\V??\\Bin\\CmdletExtensionAgents\\ScriptingAgentConfig.xml<\/code><\/p>\n\n\n\n<p>Step 3: Configure\/Create Config File (below mine with german description)&nbsp;<\/p>\n\n\n\n<p><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;<\/code><br><code>&lt;Configuration version=\"1.0\"&gt;<\/code><br><code>&lt;Feature Name=\"MailboxProvisioning\" Cmdlets=\"New-Mailbox,Enable-Mailbox\"&gt;<\/code><br><code>&lt;ApiCall Name=\"OnComplete\"&gt;<\/code><br><code>If($succeeded)<\/code><br><code>{<\/code><br><code>##################################################<\/code><br><code>### Version 2.0 by Wilhelm Holzgruber 06.02.2020 #<\/code><br><code>##################################################<\/code><br><code>### Pause sodass Mailbox erstellt werden kann und im AD repliziert wird<\/code><br><code>start-sleep -s 10<\/code><br><code>#<\/code><br><code>### Wir waehlen den ganzen AD Forest aus<\/code><br><code>Set-ADServerSettings -ViewEntireForest $true<\/code><br><code>#<\/code><br><code>### Es wird der Alias der erstellten Mailbox fuer die weitere Verarbeitung ausgewaehlt. Alternative waere auch Name oder Distinguished Name - funktioniert aber schlecht<\/code><br><code>$Mailbox = $provisioningHandler.UserSpecifiedParameters[\"Alias\"]<\/code><br><code>#<\/code><br><code>### Wir setzen folgende Parameter: Sprache, Datumsformat, Uhrzeit und Foldername = Language - WICHTIG! Sprache muss vorher gesetzt sein um danach auf :\\Kalender (nicht Calendar) zugreifen zu koennen<\/code><br><code>Set-MailboxRegionalConfiguration -Identity $Mailbox -Language \"de-DE\" -DateFormat \"dd.MM.yyyy\" -TimeFormat HH:mm -LocalizeDefaultFolderName<\/code><br><code>#<\/code><br><code>### Wir setzen die zus\u00e4tzlichen Kalenderberechtigungen - WICHTIG ohne vorige Sprachsetzung gibt es weder Kalender noch Calendar<\/code><br><code>Add-MailboxFolderPermission -Identity $Mailbox$(':\\Kalender') -User \"John Smith\" -AccessRights Reviewer<\/code><br><code>Add-MailboxFolderPermission -Identity $Mailbox$(':\\Kalender') -User \"EDIT-HumanResources\" -AccessRights Editor<\/code><br><code>#<\/code><br><code>### POP3, IMAP und ActiveSync wird deaktiviert<\/code><br><code>Set-CASMailbox $Mailbox -ImapEnabled $false -POPEnabled $false -ActiveSyncEnabled $false<\/code><br><code>#<\/code><br><code>### Bei allen Gruppenpostf\u00e4chern werden die Audit Settings gesetzt<\/code><br><code>foreach ($Mailbox in (Get-Mailbox -ResultSize Unlimited -Database Gruppe)) {Set-Mailbox -Identity \"$($Mailbox.Name)\" -AuditEnabled $true -AuditDelegate Update,Move,MoveToDeletedItems,SoftDelete,HardDelete,FolderBind,SendAs,SendOnBehalf,Create -AuditOwner Update,Move,MoveToDeletedItems,SoftDelete,HardDelete,Create -ErrorAction SilentlyContinue}<\/code><br><code>}<\/code><br><code>&lt;\/ApiCall&gt;<\/code><br><code>&lt;\/Feature&gt;<\/code><br><code>&lt;\/Configuration&gt;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below an example of my Exchange Scripting Agent. With this configuration you can set various parameters after mailbox creation. I\u00b4ve<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[3],"tags":[87,136,142],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-kb","tag-exchange-scripting-calendar","tag-microsoft","tag-microsoft-exchange"],"_links":{"self":[{"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16"}],"version-history":[{"count":0,"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/16\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winni.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}