IWMSPlugin.Enabled (C#)

The Enabled property specifies and retrieves a Boolean value indicating whether the plug-in is enabled.

Plugin.Enabled = bool;
bool = Plugin.Enabled;

Property Value

A bool indicating whether the plug-in is enabled. By default, this parameter is false.

If this property fails, it throws an exception.




This value can be returned by the WMS Anonymous User Authentication plug-in to indicate that the user name or password set through its custom administration interface does not match the settings for the Windows user account that is used for anonymous guests.


The plug-in does not support loading as either an in-process or an out-of-process component.


This value can be returned by the WMS Active Script Event Handler plug-in to indicate that it was unable to find a script engine to run the script indicated by its FileName property.


The plug-in cannot be enabled or disabled while the publishing point is running.


Only one multicast data writer plug-in can be enabled on a publishing point.


When you call the Enabled property, the server will load the plug-in if it is not already loaded. Because the Enabled property is persistent, it may not reflect the current status of the plug-in if the status changes after Enabled is called. Use the IWMSPlugin.Status property to retrieve the plug-in status.


using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer          Server;
IWMSPlugins        Plugins;
IWMSPlugin         Plugin;

bool               bEnabled;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPlugins object.
    Plugins = Server.Authenticators;

    // Retrieve information about each plug-in.
    for (int i = 0; i < Plugins.Count; i++)
        Plugin = Plugins[i];

        // Retrieve a Boolean value indicating whether
        // the plug-in is enabled.
        bEnabled = Plugin.Enabled;

        // Set a Boolean value indicating that
        // the plug-in is enabled.
        Plugin.Enabled = true;
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
catch (Exception e) {
    // TODO: Handle exceptions.


Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows ServerĀ 2003 family, Windows ServerĀ 2008 family.

See Also


IWMSPlugin Object (C#)

IWMSPlugin.Enabled (C#)

IWMSPlugin.Status (C#)

IWMSPlugins Object (C#)