### Install an add-in from a URL using Exchange Management Shell Source: https://learn.microsoft.com/en-us/Exchange/install-or-remove-outlook-add-ins-2013-help Use this command to install an add-in for your organization by providing the URL of its manifest file. ```PowerShell New-App -OrganizationApp -Url ``` -------------------------------- ### Install an add-in from a file using Exchange Management Shell Source: https://learn.microsoft.com/en-us/Exchange/install-or-remove-outlook-add-ins-2013-help Use this command to install an add-in for your organization by specifying the file path to its manifest file. ```PowerShell New-App -OrganizationApp -FileData ``` -------------------------------- ### View installed add-ins using Exchange Management Shell Source: https://learn.microsoft.com/en-us/Exchange/install-or-remove-outlook-add-ins-2013-help Execute this command in the Exchange Management Shell to list all add-ins currently installed in your organization. ```PowerShell Get-App ``` -------------------------------- ### Exchange Setup Log Snippet - Success Source: https://learn.microsoft.com/en-us/exchange/error-message-when-upgrading-cumulative-updates This log snippet shows a successful completion of the Start-PreFileCopy task, indicating no immediate issues with log file operations. ```text [04/21/2022 08:31:54.0092] [1] Ending processing Start-PreFileCopy [04/21/2022 08:31:54.0100] [0] The log file path for the language pack removal operation is set to 'C:\ExchangeSetupLogs'. [04/21/2022 08:31:54.0106] [0] ************** [04/21/2022 08:31:54.0106] [0] Setup will run the task 'remove-InstalledLanguages' ``` -------------------------------- ### Application Event Log Entry Example Source: https://learn.microsoft.com/en-us/exchange/error-message-when-upgrading-cumulative-updates This is an example of an event log entry with Event ID 1000 and source MSExchangeSetup, which is relevant for diagnosing issues. ```text Log Name: Application Source: MSExchangeSetup Date: 12/5/2022 11:33:03 AM Event ID: 1000 Task Category: Microsoft Exchange Setup Level: Information Keywords: Classic User: N/A Description: Exchange Setup (build 15.1.2507.6:Languages) was started. ``` -------------------------------- ### Exchange Setup Log Snippet - Failure Source: https://learn.microsoft.com/en-us/exchange/error-message-when-upgrading-cumulative-updates This log snippet shows the 'Access is denied' warning and indicates a failure in writing to the application log during the Start-PreFileCopy task. ```text [12/05/2022 12:22:06.0909] [1] Ending processing Start-PreFileCopy [12/05/2022 12:22:06.0914] [0] The log file path for the language pack removal operation is set to 'C:\ExchangeSetupLogs'. [12/05/2022 12:22:06.0924] [0] [WARNING] Exception has been thrown by the target of an invocation. [12/05/2022 12:22:06.0939] [0] [WARNING] Cannot open log for source 'MSExchangeSetup'. You may not have write access. [12/05/2022 12:22:06.0939] [0] [WARNING] Access is denied [12/05/2022 12:22:06.0939] [0] CurrentResult SetupLauncherHelper.loadassembly:444: 1 [12/05/2022 12:22:06.0939] [0] The Exchange Server setup operation didn't complete. More details can be found in ExchangeSetup.log located in the : ExchangeSetupLogs folder. [12/05/2022 12:22:06.0939] [0] CurrentResult main.run:235: 1 [12/05/2022 12:22:06.0939] [0] CurrentResult setupbase.maincore:396: 1 [12/05/2022 12:22:06.0939] [0] End of Setup [12/05/2022 12:22:06.0939] [0] ********************************************** ``` -------------------------------- ### Unattended Setup Switches for Diagnostic Data Source: https://learn.microsoft.com/en-us/exchange/diagnostic-data-exchange-server Use these switches during unattended command-line setup to control whether diagnostic data is shared with Microsoft. The previous /IAcceptExchangeServerLicenseTerms switch has been replaced. ```bash Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataOFF ``` -------------------------------- ### Uninstall Exchange Server from Windows Server Core Source: https://learn.microsoft.com/en-us/Exchange/release-notes-2019 Use this command to uninstall Exchange Server from Windows Server Core when the Setup Wizard fails. The _/IAcceptExchangeServerLicenseTerms_ switch requires either _DiagnosticDataON_ or _DiagnosticDataOFF_ starting with the September 2021 Cumulative Updates. ```dos Setup.exe /IAcceptExchangeServerLicenseTerms_DiagnosticDataON /mode:Uninstall ``` -------------------------------- ### Prepare Active Directory for Management Tools Update Source: https://learn.microsoft.com/en-us/Exchange/manage-hybrid-exchange-recipients-with-management-tools Before updating Exchange Server management tools to a newer Cumulative Update (CU), you must prepare Active Directory using the Setup /PrepareAD command. This command accepts license terms and enables diagnostic data collection. ```PowerShell .\Setup.EXE /PrepareAD /IAcceptExchangeServerLicenseTerms_DiagnosticDataON ``` -------------------------------- ### Enable an add-in by default (user can disable) Source: https://learn.microsoft.com/en-us/Exchange/manage-user-access-to-add-ins-2013-help This command enables an add-in and sets it to be available by default for users, but allows them to disable it if they choose. Replace with the add-in's GUID. ```powershell Set-App -Identity -OrganizationApp -Enabled $true -DefaultStateForUser Enabled ``` -------------------------------- ### Import a specific SST file using Set-SmimeConfig Source: https://learn.microsoft.com/en-us/Exchange/set-up-virtual-certificate-collection-to-validate-s-mime This example demonstrates how to import a specific SST file, 'C:\My Documents\Exported Certificate Store.sst', into the Exchange Online virtual certificate store using the Set-SmimeConfig cmdlet. ```powershell Set-SmimeConfig -SMIMECertificateIssuingCA ([System.IO.File]::ReadAllBytes('C:\My Documents\Exported Certificate Store.sst')) ``` -------------------------------- ### Enable Diagnostic Data Collection Source: https://learn.microsoft.com/en-us/exchange/diagnostic-data-exchange-server Use this command to start sending optional diagnostic data to Microsoft. Replace with the actual name of your Exchange server. ```powershell Set-ExchangeServer -Identity -DataCollectionEnabled:$true ``` -------------------------------- ### Verify Add-in Management Permissions for Organization Source: https://learn.microsoft.com/en-us/Exchange/specify-who-can-install-and-manage-add-ins-2013-help Use this command to verify which users have been assigned permissions to install and manage add-ins from the Office Store for the entire organization. Review the 'Effective Users' column in the results. ```powershell Get-ManagementRoleAssignment -Role "Org Marketplace Apps" -GetEffectiveUsers ``` -------------------------------- ### List all Outlook add-ins using Exchange Management Shell Source: https://learn.microsoft.com/en-us/Exchange/install-or-remove-outlook-add-ins-2013-help Run this command to retrieve the display names and application IDs of all installed Outlook add-ins for your organization. ```PowerShell Get-App -OrganizationApp |Format-List DisplayName,AppID ``` -------------------------------- ### Get Organization App Details Source: https://learn.microsoft.com/en-us/Exchange/manage-user-access-to-add-ins-2013-help Retrieves details about organization add-ins, including their display name, AppId, enabled status, default user state, provisioning method, and assigned user list. Used to verify add-in configuration. ```PowerShell Get-App -OrganizationApp | Format-List DisplayName,AppId,Enabled,DefaultStateForUser,ProvidedTo,UserList ``` -------------------------------- ### Load Exchange Management Shell Snap-in Source: https://learn.microsoft.com/en-us/Exchange/manage-hybrid-exchange-recipients-with-management-tools When managing recipients without an Exchange server, you can access Exchange cmdlets by installing the Exchange Management Tools and loading the Exchange snap-in manually. This is a supported method for specific scenarios. ```powershell Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn ``` -------------------------------- ### Get all organization add-ins Source: https://learn.microsoft.com/en-us/Exchange/manage-user-access-to-add-ins-2013-help Run this command to retrieve the display names and unique IDs (AppId) of all Outlook add-ins installed in your organization. The AppId is a GUID used to identify and manage specific add-ins. ```powershell Get-App -OrganizationApp | Format-List DisplayName,AppId ``` -------------------------------- ### Filter by Policy Tag (GUID) Source: https://learn.microsoft.com/en-us/exchange/filterable-properties-for-the-contentfilter-parameter Filter messages based on their policy tag using a GUID. The command resolves names to GUIDs if a GUID is not explicitly provided. ```PowerShell -ContentFilter "PolicyTag -ne '00000000-0000-0000-0000-000000000000'" ``` -------------------------------- ### Verify add-in configuration Source: https://learn.microsoft.com/en-us/Exchange/manage-user-access-to-add-ins-2013-help Run this command to confirm the configuration of your organization's add-ins, checking the Enabled and DefaultStateForUser properties. This helps verify that your changes have been applied correctly. ```powershell Get-App -OrganizationApp | Format-List DisplayName,AppId,Enabled,DefaultStateForUser ``` -------------------------------- ### Create or Set Auth Server for EvoSts Source: https://learn.microsoft.com/en-us/Exchange/hybrid-configuration-wizard-choose-configuration-feature Use this cmdlet to create or configure an authentication server for Exchange Online STS (EvoSts), specifying the metadata URL and type as AzureAD. ```PowerShell New-AuthServer or Set-AuthServer [-Name 'EvoSts - '] [-AuthMetadataUrl 'https://login.windows.net/.onmicrosoft.com/federationmetadata/2007-06/federationmetadata.xml'] [-Type AzureAD] ``` -------------------------------- ### Get Distribution Group Members Source: https://learn.microsoft.com/en-us/Exchange/manage-user-access-to-add-ins-2013-help Retrieves all members of a specified distribution group. This is a prerequisite for limiting add-in availability to a group. ```PowerShell Get-DistributionGroupMember Marketing ``` -------------------------------- ### Get Migration Endpoint for AppId Source: https://learn.microsoft.com/en-us/Exchange/manage-hybrid-exchange-recipients-with-management-tools Alternatively, retrieve the AppId by querying the migration endpoint. This command is run in Exchange Online PowerShell. ```powershell Get-MigrationEndpoint "Hybrid Migration Endpoint - EWS (Default Web Site)" | Select-Object RemoteServer ``` -------------------------------- ### Enable Exchange Online Partner Application Source: https://learn.microsoft.com/en-us/Exchange/hybrid-configuration-wizard-choose-configuration-feature Use this cmdlet to enable the 'Exchange Online' partner application, which is necessary for hybrid configurations to function correctly. ```PowerShell Set-PartnerApplication [-Identity 'Exchange Online'] [-Enabled $true] ``` -------------------------------- ### Import Hybrid Agent PowerShell Module Source: https://learn.microsoft.com/en-us/Exchange/manage-hybrid-exchange-recipients-with-management-tools Import the Hybrid Agent PowerShell module from its installation directory. This is a prerequisite for uninstalling the hybrid agent. ```powershell Import-Module .\HybridManagement.ps1 ``` -------------------------------- ### Make an add-in mandatory for all users Source: https://learn.microsoft.com/en-us/Exchange/manage-user-access-to-add-ins-2013-help Use this command to ensure an add-in is always enabled and cannot be disabled by users. Replace with the add-in's GUID. ```powershell Set-App -Identity -OrganizationApp -Enabled $true -DefaultStateForUser AlwaysEnabled ``` -------------------------------- ### Disable and hide an add-in Source: https://learn.microsoft.com/en-us/Exchange/manage-user-access-to-add-ins-2013-help Use this command to disable a specific add-in, making it unavailable to all users. Replace with the actual GUID of the add-in you want to disable. ```powershell Set-App -Identity -OrganizationApp -Enabled $false ``` -------------------------------- ### Verify All Groups Source: https://learn.microsoft.com/en-us/exchange/enable-or-disable-hierarchical-address-books-exchange-2013 Run Get-Group to display the SeniorityIndex, PhoneticDisplayName, and DisplayName for all groups in the organization. This can help in troubleshooting HAB configurations. ```PowerShell Get-Group -ResultSize unlimited | Format-Table SeniorityIndex,PhoneticDisplayName,DisplayName -Auto ``` -------------------------------- ### Verify HAB Root Configuration Source: https://learn.microsoft.com/en-us/exchange/enable-or-disable-hierarchical-address-books-exchange-2013 Run Get-OrganizationConfig to verify the HierarchicalAddressBookRoot property, confirming the HAB is enabled. ```PowerShell Get-OrganizationConfig | Format-List HierarchicalAddressBookRoot ``` -------------------------------- ### Re-run Active Directory Cleanup After Management Tools Upgrade Source: https://learn.microsoft.com/en-us/Exchange/manage-hybrid-exchange-recipients-with-management-tools After upgrading management tools with /PrepareAD, it's necessary to re-run the CleanupActiveDirectoryEMT.ps1 script. This is because /PrepareAD may recreate objects that the cleanup script removes. Ensure this is only run in environments where Exchange servers are no longer active and the script was previously executed. ```PowerShell .\CleanupActiveDirectoryEMT.ps1 ``` -------------------------------- ### Get Federation Certificate Thumbprint Source: https://learn.microsoft.com/en-us/Exchange/manage-hybrid-exchange-recipients-with-management-tools Retrieve the thumbprint of the federation certificate to be used for removal. This command filters Exchange certificates to find the one with the subject 'CN=Federation'. ```powershell $fedThumbprint = (Get-ExchangeCertificate | Where-Object {$_.Subject -eq "CN=Federation"}).Thumbprint ``` -------------------------------- ### Remove a custom add-in using Exchange Management Shell Source: https://learn.microsoft.com/en-us/Exchange/install-or-remove-outlook-add-ins-2013-help Use this command to remove a specific custom add-in from your organization. Replace the placeholder with the actual GUID of the add-in. ```PowerShell Remove-App -OrganizationApp -Identity ``` -------------------------------- ### Verify HAB Groups Source: https://learn.microsoft.com/en-us/exchange/enable-or-disable-hierarchical-address-books-exchange-2013 Use Get-Group to list all groups that are part of the HAB, displaying their SeniorityIndex, PhoneticDisplayName, and DisplayName. ```PowerShell Get-Group -ResultSize unlimited | where {$_.IsHierarchicalGroup -match 'True'} | Format-Table SeniorityIndex,PhoneticDisplayName,DisplayName -Auto ``` -------------------------------- ### Configure On-premises to O365 Organization Relationship Settings Source: https://learn.microsoft.com/en-us/Exchange/hybrid-configuration-wizard-choose-configuration-feature Use this cmdlet to configure settings for an existing on-premises to Exchange Online organization relationship. This enables features like mailbox moves and free/busy sharing. ```PowerShell Set-OrganizationRelationship [-Identity 'On-premises to O365 - '] [-MailboxMoveEnabled $true] [-FreeBusyAccessEnabled $true] [-FreeBusyAccessLevel LimitedDetails] [-ArchiveAccessEnabled $true] [-MailTipsAccessEnabled $true] [-MailTipsAccessLevel All] [-DeliveryReportEnabled $true] [-PhotosEnabled $true] [-TargetOwaURL 'https://outlook.office.com/mail'] ``` -------------------------------- ### Get Organization Relationship for AppId Source: https://learn.microsoft.com/en-us/Exchange/manage-hybrid-exchange-recipients-with-management-tools Retrieve the Organization Relationship to find the TargetSharingEpr, which contains the AppId needed for removing the hybrid application. This is used in Exchange Online PowerShell. ```powershell Get-OrganizationRelationship ((Get-OnPremisesOrganization).OrganizationRelationship) | Select-Object TargetSharingEpr ```