/// <summary>
        /// Initialize a new VirtualServerManager using a specified server
        /// and default virtual server.
        /// </summary>
        /// <param name="serverName">Specific server name.</param>
        /// <param name="defaultSite">Default virtual server.</param>
        public VirtualServerManager(
            string serverName,
            int defaultVirtualServer,
            string defaultAppPool)
            : base(serverName, @"Root\MicrosoftIISv2", "IIS://", "/W3SVC")
        {
            this.defaultVirtualServerPath =
                new VirtualServerPath(defaultVirtualServer);

            this.defaultApplicationPoolPath =
                "IIsApplicationPool='W3SVC/AppPools/" + defaultAppPool + "'";
        }
Beispiel #2
0
 /// <summary>
 /// Initialize a new private IIS Virtual Server.
 /// </summary>
 /// <param name="description">Shows in the IIS snap-in as comment.</param>
 /// <param name="homeDirectory">Location of the website files.</param>
 /// <param name="redirectUrl">URL to redirect to.</param>
 /// <param name="applicationPool">Application pool to use.</param>
 /// <param name="bindings">Any number of bindings.</param>
 /// <param name="authFlags">
 /// Basic should be used if HTTPS is not enabled, and NTLM should be
 /// used to enable windows integrated authentication.
 /// </param>
 /// <param name="accessFlags">Reflects user access to website.</param>
 public VirtualServer(
     string description,
     string homeDirectory,
     string applicationPool,
     IEnumerable <VirtualServerBinding> bindings,
     VirtualServerAccessFlag accessFlags,
     VirtualServerAuthFlag authFlags,
     VirtualServerPath path)
     : this(
         description,
         homeDirectory,
         null,
         applicationPool,
         bindings,
         authFlags,
         accessFlags,
         null,
         VirtualServerRedirectFlag.None,
         path)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Create a new IIS Virtual Server redirect.
 /// </summary>
 /// <param name="description">Shows in the IIS snap-in as comment.</param>
 /// <param name="redirectUrl">URL to redirect to.</param>
 /// <param name="redirectFlags">HttpRedirect append flags.</param>
 /// <param name="anonymousUser">Anonymous windows user.</param>
 /// <param name="homeDirectory">Required for redirect, not null.</param>
 /// <param name="bindings">Any number of bindings.</param>
 public VirtualServer(
     string description,
     string redirectUrl,
     VirtualServerRedirectFlag redirectFlags,
     WindowsUser anonymousUser,
     string homeDirectory,
     IEnumerable <VirtualServerBinding> bindings,
     VirtualServerPath path)
     : this(
         description,
         homeDirectory,
         anonymousUser,
         null,
         bindings,
         VirtualServerAuthFlag.Anonymous,
         VirtualServerAccessFlag.AccessRead,
         redirectUrl,
         redirectFlags,
         path)
 {
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new Virtual Server (all prarameters - protected).
 /// </summary>
 /// <param name="description">Shows in the IIS snap-in as comment.</param>
 /// <param name="homeDirectory">Location of the website files.</param>
 /// <param name="applicationPool">Application pool to use.</param>
 /// <param name="bindings">Any number of bindings.</param>
 /// <param name="authFlags">
 /// Basic should be used if HTTPS is not enabled, and NTLM should be
 /// used to enable windows integrated authentication.
 /// </param>
 /// <param name="accessFlags">Reflects user access to website.</param>
 /// <param name="redirectUrl">URL to redirect to, null accepted.</param>
 /// <param name="redirectFlags">HttpRedirect append flags.</param>
 protected VirtualServer(
     string description,
     string homeDirectory,
     WindowsUser anonymousUser,
     string applicationPool,
     IEnumerable <VirtualServerBinding> bindings,
     VirtualServerAuthFlag authFlags,
     VirtualServerAccessFlag accessFlags,
     string redirectUrl,
     VirtualServerRedirectFlag redirectFlags,
     VirtualServerPath path)
 {
     this.description     = description;
     this.homeDirectory   = homeDirectory;
     this.applicationPool = applicationPool;
     this.bindings        = bindings;
     this.authFlags       = authFlags;
     this.accessFlags     = accessFlags;
     this.redirectUrl     = redirectUrl;
     this.redirectFlags   = redirectFlags;
     this.anonymousUser   = anonymousUser;
     this.path            = path;
 }