agentName = "Spam Analysis Routing Agent"; $agentFactory = "Microsoft.Exchange.AntiSpam.SpamAnalysis.RoutingAgent.SpamAnalysisRoutingAgentFactory"; ...

$agentName = "Spam Analysis Routing Agent";                    $agentFactory = "Microsoft.Exchange.AntiSpam.SpamAnalysis.RoutingAgent.SpamAnalysisRoutingAgentFactory";                    $agentAssembly = ($RoleInstallPath + "TransportRoles\agents\Hygiene\Microsoft.Exchange.AntiSpam.SpamAnalysis.RoutingAgent.dll");                    $agent = get-transportagent -Identity:$agentName;                    if ($agent)                    {                        uninstall-transportagent -Identity:$agentName;                    };                    install-TransportAgent -Name:$agentName -TransportAgentFactory:$agentFactory -AssemblyPath:$agentAssembly;                    ## Set priority order to be just before Spam Filter Agent                    $spamFilterAgent = get-transportagent -Identity:"Spam Filter Agent";                    if ($spamFilterAgent)                    {                        set-transportagent -Identity:$agentName -Priority:$spamFilterAgent.Priority                    }                    ## Enable it back only if it is new or it was in enabled state prior to uninstall                    if (!$agent -or $agent.enabled)                    {                        enable-transportagent -Identity:$agentName                    };
English
English (United States)
Français (France)
French (France)