intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Exchange SQL And IIS- P174

Chia sẻ: Cong Thanh | Ngày: | Loại File: PDF | Số trang:5

57
lượt xem
2
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Exchange SQL And IIS- P174:The following legacy Exchange features have been de-emphasized in Exchange Server 2007. What does that mean? It means that these features are still included in the Exchange product, but they’re not prioritized anymore, and will most likely disappear in the next Exchange release after Exchange Server 2007

Chủ đề:
Lưu

Nội dung Text: Exchange SQL And IIS- P174

  1. 842 Chapter 16 • Administration of an IIS 7.0 Web Server To create a new application pool, use the following: using System; using System.Collections.Generic; using System.Text; using Microsoft.Web.Administration; namespace MSWebAdmin_Application { class CreateApplicationPool() { private static void CreateApplicationPool() { using (ServerManager serverManager = new ServerManager() ) { ApplicationPool appPool = serverManager.ApplicationPools.Add(“My First MWA AppPool”); appPool.ProcessModel.UserName = “”; appPool.ProcessModel.Password = “”; } } } Assign My First MWA Site to the new application pool: using System; using System.Collections.Generic; using System.Text; using Microsoft.Web.Administration; namespace MSWebAdmin_Application { class AssignApplicatonPoolToSite(“My First MWA Site”, “/”, “My First MWA AppPool”); private static void AssignApplicationPoolToSite(string siteName, string applicationPath, string applicationPoolName) { using (ServerManager serverManager = new ServerManager() ) { serverManager.Sites[siteName].Applications[applicationPath].ApplicationPoolName = applicationPoolName; serverManager.CommitChanges(); } } }
  2. Administration of an IIS 7.0 Web Server • Chapter 16 843 Changing the Authentication Type for a Web Site Using MWA Multiple properties are customizable for your Web sites, yet many times you will not touch them. The principles often are the thing to grasp, and in this illustration we will touch on one of those often changed settings: authentication. The goal though is to get away from creating sites or virtual directories and modifying actual site settings. This could stretch to things like adding modules, handlers, default documents, and much, much more. In this example, you will enable Windows authentication for our newly created Web site. using System; using System.Collections.Generic; using System.Text; using Microsoft.Web.Administration; namespace MSWebAdmin_Application { class EnableWindowsAuthentication(“My First MWA Site”) private static void EnableWindowsAuthentication(string siteName) { using (ServerManager serverManager = new ServerManager() ) { Configuration appHostConfig = serverManager.GetApplicationHostConfiguration(); // Enable Windows Authentication ConfigurationSection windowsAuthentication = appHostConfig.GetSection(“system.webServer/security/authentication/ windowsAuthentication”, siteName); windowsAuthentication.SetAttributeValue(“enabled”, true); // Disable Anonymous Authentication ConfigurationSection anonymousAuthentication = appHostConfig.GetSection(“system.webServer/security/authentication/ anonymousAuthentication”, siteName); anonymousAuthentication.SetAttributeValue(“enabled”, false); serverManager.CommitChanges(); } } }
  3. 844 Chapter 16 • Administration of an IIS 7.0 Web Server Viewing Currently Executing Requests Using MWA To access currently executing requests in IIS 7.0 using MWA, you do much of what you did earlier except you change the object you are using so it points to IIS 7.0 runtime objects. In this example, you will need to ensure you have executing requests running to ensure that data is returned. In this example, you will view any currently executing requests occurring in IIS 7.0: using System; using System.Collections.Generic; using System.Text; using Microsoft.Web.Administration; namespace MSWebAdmin_Application { class DisplayRequests () private static void DisplayRequests() { using (ServerManager serverManager = new ServerManager() ) { foreach (WorkerProcess workerProcess in serverManager.WorkerProcesses) { Console.WriteLine(workerProcess.ProcessId); foreach (Request request in workerProcess.GetRequests(0) ) { Console.WriteLine(“{0} - {1} - {2}”, request.Url, request.PipelineState, request.TimeElapsed); } } } } }
  4. Administration of an IIS 7.0 Web Server • Chapter 16 845 Summary Like Baskin Robbins’ 31 flavors, IIS 7.0 has a talented array of administration features. Whether you subscribe to the user interface flavor, command line, or writing scripts or code, there is a flavor for everyone. Unlike previous IIS versions, there has never been such a powerful lineup of configuration opportunities for Microsoft’s Web platform. As an administrator or developer, you must pick the tool that is right for your environment. You can select IIS Manager for a user interface experience, AppCmd.exe when using the command line, or use WMI or Microsoft.Web.Administration for scripting changes in IIS 7.0’s configuration and to access runtime data. In this chapter, you have gained insight into the powerful stack of administration capabilities built directly into IIS 7.0. There is a method for manipulating the IIS 7.0 configuration that fits any flavor of administrator from the user interface to the managed-code administrator. This isn’t to say that IIS 7.0 has everything in-between. It was important to start with the most common toolset used for day-to-day administration: IIS Manager. IIS Manager, re-built from the ground up, provides a new look and feel while maintaining most of the necessary tools to completely manage IIS. It offers you the ability to manage both IIS and ASP.NET settings in a consolidated, grouped, approach as well as provide you with delegated administration. IIS Manager supports both previous clients such as Windows XP and Windows 2003 Server, along with Windows Vista and Windows Server “Codenamed” Longhorn. You can download IIS Manager from the IIS.NET DownloadCENTER at www.iis.net/downloads/default.aspx?tabid=3. For some, the experience of learning IIS Manager is tedious and not what they desire to do. They prefer to use the command line to improve their experience with IIS 7.0’s configuration. IIS 7.0 offers a powerful desktop command-line interface called AppCmd.exe that offers access using simple syntax and strong object support. From creating Web sites to viewing currently executed requests or migrating legacy configuration, AppCmd.exe offers a Swiss-army-knife-like experience for those desiring command-line support. The reality in the Web server world is in deployments, not in doing individual tasks that IIS Manager and AppCmd.exe specialize in. For those desiring automated, deployable, and maintainable scripts, IIS 7.0 offers you the ability to use WMI and MWA. In the end, IIS 7.0 provides a complete end-to-end story in the administration space, offering the best lineup of toolsets ever shipped with IIS. Solutions Fast Track Accomplishing Tasks Using IIS Manager ˛ IIS Manager offers easy access to all relevant features in an excellent three-column view. ˛ Creating Web sites, virtual directories, and much more is simple and intuitive with the redesign of IIS Manager. ˛ IIS Manager in IIS 7.0 offers a consolidated interface for managing IIS and ASP.NET settings.
  5. 846 Chapter 16 • Administration of an IIS 7.0 Web Server Accessing Information Using AppCmd.exe ˛ AppCmd.exe offers command-line access to IIS 7.0 configuration, server objects, and runtime data, such as requests executing. ˛ AppCmd.exe offers powerful object access, including creating and managing configuration backups for applicationhost.config. ˛ AppCmd.exe is available in %windir%\system32\inetsrv, but is easily addable to the system path for quick access. Writing Scripts Using the New WMI Provider ˛ WMI is rewritten in IIS 7.0 to support IIS’s new configuration as well as extensibility. ˛ WMI is a nice means of automating tasks that are repetitive and usable across many machines. ˛ WMI can perform all the same tasks as IIS Manager and AppCmd.exe, all from a scripting, remotable interface. Managed Code Administration: Inside Microsoft.Web. Administration ˛ Microsoft.Web.Administration (MWA) offers managed-code users the ability to manage IIS 7.0 configuration and other data. ˛ MWA supports all the .NET Framework languages and is easy to add as a reference in Visual Studio. ˛ MWA, like all other toolsets, is capable of creating Web sites, virtual directories, applications, and much, much more.
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
5=>2