Automatic script PowerShell Deployment Scheme

Source: Internet
Author: User

One thing the IT industry has agreed on is that a standard-based, cross-platform, and scalable automation tool is worth investing. However, guis provided by different vendors have their own advantages, and PowerShell can be used for most automation requirements. Whether you hate it or like it, you need to use it-you will take the initiative or be forced to use it for automation.

IT administrators who use Unix operating systems have been using PowerShell for decades. They know that true automation means real-time interaction of many objects at the same time, and automation scripts are the most flexible way. This is implemented through the command line shell, and the most popular shell is PowerShell. It has been adopted by VMware, Microsoft SCVMM, and Citrix XenApp.

The following is an example. The business department needs to deploy a new Web Server and run the Active Server Pages. NET application on it. The traditional solution may be as follows:

• Login Server

• Open the GUI Server Manager

• Select the desired role and role Service

• Restart the server

The PowerShell-based solution is as follows:

• Login Server

• Open PowerShell and enter:

• PS> Install-WindowsFeature Web-Server, web-Asp-Net

This is no big difference for small-scale demands. If 50 Web servers in the Server Load balancer cluster need to run new ASP. NET applications, the GUI administrator's work will become as follows:

• Login Server

• Open the GUI Server Manager

• Select the desired role and role Service

• Restart the server

• The next server repeats for 50 times)

This solution requires several hours to a few weeks without generating any log documents, and may also cause human errors such as forgetting to add ASP. NET. Automation Experts use the following methods to complete this task:

• Open PowerShell and enter:

• PS> Invoke-Command-ComputerName Web1, Web2, Web3 {Install-WindowsFeature Web-Server, web-Asp-Net}

Yes. The host name can be obtained from a. CSV file or from the Active Directory, but the commands are basically the same. The significance of this example is that by using PowerShell Remoting, you can install and configure 50 servers in a few minutes. This is a simple example, but the meaning is very clear: I can complete all the work in a few minutes, and I am more valuable to the business than the GUI administrator.

These scripts are mandatory or one by one) commands are sent to the computer to deploy and configure the software. PowerShell v4 provides a definition method similar to Puppet or Chef in Unix to manage and control system configurations.

Return to my father-in-law and T series experiences. He knows how to start the car, but if I want to start the car, I need to find my father-in-law to start it for me, so that I do not need to understand any steps.

PowerShell v4 has an "ideal state configuration", which means that I can define a requirement like "I need 50 new Web servers with certain functions", and then the resources will be executed step by step) it will execute my plan without understanding the details. This can be used only for application and server deployment. It can also prevent unnecessary configuration by other administrators after large-scale "drift ).

PowerShell automation provides IT administrators with a cross-platform tool to deploy and maintain their ideal state. It allows CIOs to deploy 50 new Web servers within minutes. In short, if automation is used properly, IT department can better meet business needs.

It happened that my father-in-law liked the Startup Process of the old T series. However, for key business needs, it is best to achieve automation to ensure security and reliability.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.