Remove a custom Exchange 2010 Transport Agent

Description

This PowerShell script removes a custom transport agent from a single Exchange 2010 server.

Examples

.\uninstall.ps1

Script

# uninstall.ps1
# -------------------------------------------------
# Uninstalls a transport agent on an Exchange Server 2010 development server
#
# Copyright (c) 2013/2016 Thomas Stensitzki
#
# $EXDIR needs to be adjusted to the target environment
$EXDIR='D:\Program Files\Microsoft\Exchange Server\V14'

# Stop the transport service to remove the agent
Stop-Service MSExchangeTransport

# Disable the transport agent
Write-Output -InputObject "Disabling Agent..."
Disable-TransportAgent -Identity "SFTools Modify Attachment Agent" -Confirm:$false

# Uninstall the transport agent
Write-Output 'Uninstalling Agent..'
Uninstall-TransportAgent -Identity "SFTools Modify Attachment Agent" -Confirm:$false

# Restart IIS as the W3SVC service locks the agent DLL
Write-Output 'Restarting IIS'Restart-Service w3svc

# Remove transport agent files from the file system
Write-Output 'Deleting Files and Folders...'
Remove-Item $EXDIR\TransportRoles\Agents\MessagingModifyAttachment* -Recurse -ErrorAction SilentlyContinue
Remove-Item $EXDIR\TransportRoles\Agents\MessagingModifyAttachment -Recurse -ErrorAction SilentlyContinue

# Start the transport service
Start-Service MSExchangeTransport

# We are finishedWrite-Output 'Uninstall Complete.'

Version History

  • 1.0, Initial community release

Links

Follow

Kurz-URL | Short URL: https://granikos.eu/go/WARe

Kommentar verfassen

Sie sehen gerade einen Platzhalterinhalt von Standard. Um auf den eigentlichen Inhalt zuzugreifen, klicken Sie auf die Schaltfläche unten. Bitte beachten Sie, dass dabei Daten an Drittanbieter weitergegeben werden.

Mehr Informationen

Entdecke mehr von Granikos GmbH & Co. KG

Jetzt abonnieren, um weiterzulesen und auf das gesamte Archiv zuzugreifen.

Weiterlesen