• No se han encontrado resultados

LA IMPORTANCIA DE LA LACTANCIA MATERNA EN ODONTOLOGÍA

As a Windows Server administrator, you can use Windows PowerShell to install and configure native Windows Server 2012 R2 roles and features, and to administer software such as Microsoft Exchange Server 2013 and Microsoft System Center 2012 R2. Although you can use a graphical user interface (GUI) for administration, using Windows PowerShell with these applications enables bulk administration. This provides the ability to create automation scripts for administration and access to configuration options that are not available when you use a GUI. Some tasks that you can perform in Windows PowerShell, such as listing the contents of a directory, likely will already be familiar to you. To use Windows PowerShell effectively, you must have a basic understanding of how it works and how to use it.

Lesson Objectives

After completing this lesson, you will be able to: • Describe Windows PowerShell.

• Describe the Windows PowerShell syntax. • Describe cmdlet aliases.

• Use the Windows PowerShell Integrated Scripting Environment (ISE). • Access Help in Windows PowerShell.

• Describe Windows PowerShell modules. • Describe Windows PowerShell remoting.

• Describe the new features in Windows PowerShell in Windows Server 2012 R2.

What Is Windows PowerShell?

Windows PowerShell is a command line manage- ment interface that you can use to configure Windows Server 2012 R2 and products such as System Center 2012 R2, Exchange Server 2013, and Microsoft SharePoint® Server 2013. This

management interface provides an alternative to the GUI management and enables admini- strators to:

• Create automation scripts. • Perform batch modifications.

• Access settings that might be unavailable or more difficult to configure in the GUI.

A GUI can guide you through complex operations, and can help you understand your choices. However, a GUI can be inefficient for tasks that you have to perform repeatedly, such as creating new user accounts. By building administrative functionality in the form of Windows PowerShell commands, you can select the correct method for a given task.

MCT USE ONL

Y. STUDENT USE PROHIBITED

Upgrading Your Skills to MCSA Windows Server® 2012 2-3

As you become more comfortable with Windows PowerShell, you can use it in place of other low-level administrative tools that you may have used. For example, Windows PowerShell has access to some of the same features that Microsoft Visual Basic Scripting Edition (VBScript) does, but in many cases provides easier ways to perform the same tasks.

Windows PowerShell may also change the way you use Windows Management Infrastructure (WMI). Windows PowerShell can wrap task-specific commands around the underlying WMI functionality. When you use Windows PowerShell with WMI, your work is simplified because Windows PowerShell provides access to WMI classes, properties, and methods while using the simplicity of Windows PowerShell syntax and cmdlets.

Windows PowerShell Syntax

Windows PowerShell has rules for naming and implementing functionalities. For example, Windows PowerShell commands, known as cmdlets, use a naming convention of verb or action, followed by a hyphen and a noun or subject. For example, to retrieve a list of virtual machines (VMs), you would use the Get-VM cmdlet. This standardization helps you more easily learn how to perform administrative tasks. For example, to change settings of a virtual machine, you would use the Set-VM cmdlet.

Note: Developers usually extend Windows

PowerShell by creating sets of cmdlets for specific products. Remember that all cmdlets should follow the same verb-noun syntax, and Microsoft has a list of approved verbs that can be used in Windows PowerShell.

Additional Reading: For more information about verbs for Windows PowerShell

commands, see “Approved Verbs for Windows PowerShell Commands” by visiting the following link: http://go.microsoft.com/fwlink/?LinkID=331439.

Optionally, one or more parameters can be used with a cmdlet to modify its behavior or specify settings. Parameters are written after the cmdlet. Each parameter that is used is separated by a space, and begins with a hyphen. Not all cmdlets use the same parameters. Some cmdlets have parameters that are unique to its functionality. For example, the Move-Item cmdlet has the Destination parameter to specify the location to move the object; whereas the Get-ChildItem has the -Recurse parameter, which you can use to iterate through subfolders. There are several kinds of parameters, including the following:

• Named. Named parameters are most common. These are parameters that can be specified by using a hyphen followed by the parameter name. Named parameters require a value or modifier. For

example, by using the Move-Item cmdlet, you would specify the -Destination parameter, along with the exact destination where the item should be moved.

• Switch. Switch parameters modify the behavior of the cmdlet, but do not require any additional modifiers or values. For example, you can specify the -Recurse parameter without specifying a value of $True.

MCT USE ONL

Y. STUDENT USE PROHIBITED

2-4 Managing Windows Server 2012 by Using Windows PowerShell

Positional. Positional parameters are parameters that can be omitted and can still accept values based on where the information is specified in the command. For example, you could run

Get-EventLog -EventLog System to retrieve information from the System event log. However,

because the -EventLog positional parameter accepts values for the first position, you can also run

Get-EventLog System to get the same results. When the -EventLog parameter is not present, the

cmdlet still accepts the value of System because it is the first item after the cmdlet name. Parameters that are common to many cmdlets include options to test the actions of the cmdlet or to generate verbose information about the execution of cmdlet. Common parameters include:

-Verbose. This parameter displays detailed information about the performed command. You should use this parameter to obtain more information about the execution of the command.

-WhatIf. This parameter displays the outcome of running the command without running the actual command. This is helpful when you are testing a new cmdlet or script, and you do not want the cmdlet to run.

• -Confirm. This parameter displays a confirmation prompt before executing the command. This is helpful when you are running scripts and you want to prompt the user before executing a specific step in the script.

Note: You can view a list of common parameters by running the following command in Windows PowerShell ISE or the Windows PowerShell management shell:

Get-Help about_CommonParameters