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
- Download and follow at Github: https://github.com/Apoc70/TransportAgent2010
Follow
- Twitter @stensitzki
Teilen mit:
- Klick, um über Twitter zu teilen (Wird in neuem Fenster geöffnet)
- Klick, um auf Facebook zu teilen (Wird in neuem Fenster geöffnet)
- Klick, um auf LinkedIn zu teilen (Wird in neuem Fenster geöffnet)
- Klicken, um auf Telegram zu teilen (Wird in neuem Fenster geöffnet)
- Klicken, um einem Freund einen Link per E-Mail zu senden (Wird in neuem Fenster geöffnet)