IWMSAdminAnonUser Object (C#)

When you enable the WMS Anonymous User Authentication plug-in, a client can attempt to connect to the server without providing a user name or password. The client is granted the access permissions specified an account that Windows Media Services has been configured to use as the anonymous user account. You can use the IWMSAdminAnonUser object to retrieve the name of the user account and specify a user name and password for use during the authorization process. The IWMSAdminAnonUser object exposes the following properties and methods.

Property

Description

AnonymousUserName

Retrieves the name of the Windows Media user account that is used to specify access permissions when an anonymous user connects to a Windows Media server.

IsPasswordSet

Retrieves a Boolean value indicating whether a password has been associated with anonymous user connections.

Method

Description

SetUserNamePassword

Specifies a user name and password for the authorization process.

Example

The following example illustrates how to retrieve an IWMSAdminAnonUser object.

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

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSAdminAnonUser AdminAnonUser;

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

    // Retrieve the plug-in to be configured.
    Plugin = Server.Authenticators[
                    "WMS Anonymous User Authentication"];

    // Retrieve the custom interface of the plug-in.
    AdminAnonUser =
        (IWMSAdminAnonUser)Plugin.CustomInterface;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

See Also

Concepts

System Plug-ins (C#)