Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Managing Windows Server 2012 Systems : Configuring Roles, Role Services, and Features (part 6) - Tracking installed roles, role services, and features

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
10/25/2014 9:02:27 PM

Tracking installed roles, role services, and features

As discussed previously, you can determine the roles, roles services, and features that are installed on a server by typing get-windowsfeature at a PowerShell prompt. Each installed role, role service, and feature is highlighted and marked as such, with roles and role services listed in the output before features as shown in the following example:

Display Name                                      Name                Install State
------------ ---- -------------
[ ] Active Directory Certificate Services AD-Certificate Available
[ ] Certification Authority ADCS-Cert-Authority Available
[ ] Certificate Enrollment Policy Web Service ADCS-Enroll-Web-Pol Available
[ ] Certificate Enrollment Web Service ADCS-Enroll-Web-Svc Available
[ ] Certification Authority Web Enrollment ADCS-Web-Enrollment Available
[ ] Network Device Enrollment Service ADCS-Device-Enrollment Available
[ ] Online Responder ADCS-Online-Cert Available
[X] Active Directory Domain Services AD-Domain-Services Installed

...

[X] .NET Framework 4.5 Features NET-Framework-45-Fea... Installed
[X] .NET Framework 4.5 NET-Framework-45-Core Installed
[X] ASP.NET 4.5 NET-Framework-45-ASPNET Installed
[X] WCF Services NET-WCF-Services45 Installed
[ ] HTTP Activation NET-WCF-HTTP-Activat... Available
[ ] Message Queuing (MSMQ) Activation NET-WCF-MSMQ-Activat... Available
[ ] Named Pipe Activation NET-WCF-Pipe-Activat... Available
[X] TCP Activation NET-WCF-TCP-Activati... Installed
[X] TCP Port Sharing NET-WCF-TCP-PortShar... Installed
[ ] Background Intelligent Transfer Service (B... BITS Available
[ ] IIS Server Extension BITS-IIS-Ext Available
[ ] Compact Server BITS-Compact-Server Available
[ ] BitLocker Drive Encryption BitLocker Available

Because the –Name parameter, which allows you to look for components with a specific name, accepts wildcards, you can easily check the installation status and availability of related components. This example returns a list of components with a management name that starts with NET or web:

get-windowsfeature -name net*, web*

Technically, you don’t need to include –Name. The –Name parameter is the first expected parameter. Thus, you could perform the previous search by entering the following as well:

get-windowsfeature net*, web*

Because you won’t always be working with a local computer at the prompt, you can use the –ComputerName parameter to specify the name or IP address of the remote computer you want to work with. In this example, you get the status of components on CorpServer18:

get-windowsfeature -computername corpserver18

For the purposes of documenting a server’s configuration, you can save the output in a file as standard text using the redirection symbol (>) as shown in this example:

get-windowsfeature > MySavedResults.txt

Here, you save the output to a file named MySavedResults.txt in the current (working) directory.

Installing components at the prompt

You can install roles, role services, and features by typing Install-WindowsFeature ComponentName at an elevated prompt, where ComponentName is the management name of the component to install as listed in Table 3 or Table 4. In the following example, you install DHCP Server and the DHCP console for managing DHCP Server on CorpServer15:

Install-windowsfeature dhcp -ComputerName corpserver15 -includemanagementtools

Here, you don’t need to include the –IncludeAllSubFeature parameter because DHCP Server doesn’t have any subordinate role services or features. As PowerShell works, you see a Start Installation progress bar. When the installation is complete, you see the result. The output for a successful installation should look similar to the following:

Success Restart Needed Exit Code      Feature Result
------- -------------- --------- --------------

True No Success {DHCP Server}

As you can see, the output specifies whether the installation was successful, whether a restart is needed, an exit code, and a list of the exact change or changes made. The exit code can be different from the Success status. For example, if the components you specify are already installed, the exit code is NoChangeNeeded, as shown in this example and sample output:

Success Restart Needed Exit Code             Feature Result
------- -------------- --------- --------------

True No NoChangeNeeded {}

Here, you see that Install-WindowsFeature was successful but didn’t actually make any changes. The Feature Result shows no changes as well.

You don’t have to explicitly name the component or components you want to install. Install-WindowsFeature accepts redirected output for component names, allowing you to use another command to get the name or names of the components you want to work with. For example, if you want to install multiple components, such as all .NET components across the multiple .NET Frameworks that are available, you could use Get-WindowsFeature to help you do this, as shown in the following example:

get-windowsfeature -name NET-* | install-windowsfeature

Here, you use Get-WindowsFeature to obtain a list of components with names that start with NET– and then pipe that list to Install-WindowsFeature. The result is that you install all .NET components across all available .NET frameworks.

Component installation doesn’t always succeed, and that’s a common reason that the server cannot be accessed, as shown in this example, with accompanying error text:

Success Restart Needed Exit Code      Feature Result
------- -------------- --------- --------------
False Maybe Failed {}

install-windowsfeature : WinRM cannot process the request. The following error
occurred while using Kerberos authentication: Cannot find the computer
corpserver15. Verify that the computer exists on the network and that the
name provided is spelled correctly.

Here, Windows Remote Management (WinRM) couldn’t connect to the remote computer. Typically, this occurs because the server is offline or otherwise unavailable. This also could occur if you entered an incorrect server name.

TROUBLESHOOTING: Resolving authentication failure

Less common reasons for authentication failure include improper WinRM configuration or a Kerberos authentication issue:

  • Regarding WinRM, the server might not be enabled for remote management in Server Manager. To resolve this, log on to the server console (either locally or via Remote Desktop), open Server Manager, and then select the Local Server Node. If Remote Management is listed as Disabled, click the related link, select Enable Remote Management, and then tap or click OK.

  • Regarding Kerberos, the authentication failure could be related to a disparity between the local computer’s date and time and the remote computer’s date and time. With Kerberos, authentication fails if the message time stamp is off by more than the allowable time difference.

Inadequate user rights is another common reason for component installation to fail, as shown in this example, with accompanying error text:

install-windowsfeature : You do not have adequate user rights to make changes to
the target computer. If you are already a member of the Administrators group on
the target computer, the changes might have failed because of security restrictions
imposed by User Account Control. Try running Install-WindowsFeature in a Windows
PowerShell session that has been opened with elevated rights (Run as administrator).

Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
False No Failed {}

Normally, when you are using Windows PowerShell for administration, you’ll use an elevated, administrator prompt and your current credentials will pass through to remote computers you work with. However, if your account doesn’t have appropriate user rights, you need to provide different credentials and you can do this using the –Credential parameter. You’ll be prompted for the user’s password if you follow the –Credential parameter with a user name, as shown in this example:

Install-windowsfeature dns -credential "CPANDL\wrstanek" -includemanagementtools

Here, you simply type the password and press Enter when prompted to run the command with the named account’s permissions. Rather than enter credentials for an account each time you want to perform administration, you can store credentials and then refer to the stored credential, as shown in this example:

$cred = get-credential
install-windowsfeature dns -credential $cred -includemanagementtools

Here, you use Get-Credential to prompt for a user name and password, and then store those credentials in the $cred variable. Next, you refer to the stored credentials to install DNS. Because the credentials are stored for the duration of your current PowerShell session, you can refer to them as needed for additional administration as well.

TROUBLESHOOTING: Understanding stored credentials

Stored credentials are available only in the current PowerShell session. The stored credentials are cleared when you close the PowerShell window. If you have multiple PowerShell windows open, the credentials stored in one window aren’t available in another window’s session.

To test the installation prior to performing that actual operation, you can use the –Whatif parameter, as shown in the following example:

get-windowsfeature -name BIT* | install-windowsfeature -whatif

If you run this command, you might be surprised to see that BitLocker components are included along with BITS components. To resolve this, you need to be more specific when specifying the component name to match. If you intend to install BitLocker and BitLocker Network Unlock, you can use the following command instead:

get-windowsfeature -name bitlock* | install-windowsfeature -whatif

If a restart is required to complete an installation, you can have Install-WindowsFeature restart the computer by including the –Restart parameter. For planning purposes, especially on highly active production servers, keep in mind that both successful and failed installations could require a restart.

Removing components at the prompt

You can uninstall roles, role services, and features by typing Uninstall-ServerManager ComponentName at an elevated command prompt, where ComponentName is the name of the component to uninstall as listed in Table 3 or Table 4. Because Uninstall-ServerManager automatically uninstalls any subordinate role services and features of the specified component, you normally want to test the uninstallation prior to performing that actual operation. To do this, you can use the –Whatif parameter, as shown in the following example:

uninstall-windowsfeature net-framework-45-features -whatif

Here, you want to uninstall .NET Framework 4.5 and related features, which include .NET Framework 4.5 (NET-Framework-45-Core), ASP.NET 4.5 (NET-Framework-45-ASPNET), and multiple subcomponents of WCF Services (NET-WCF-Services45). However, if you want to uninstall only the WCF Services, you enter the following instead:

uninstall-windowsfeature net-wcf-services45

As with Install-WindowsFeature, you don’t have to explicitly name the component or components you want to uninstall. Uninstall-WindowsFeature accepts redirected output for component names, allowing you to use another command to get the name or names of the components you want to work with. For example, if you want to uninstall multiple components, such as all .NET components across the multiple .NET Frameworks that are available, you could use Get-WindowsFeature to help you do this, as shown in the following example:

get-windowsfeature -name NET-* | uninstall-windowsfeature

To ensure that the command works exactly as expected, you should test the command first using the –Whatif parameter, as shown in the following example:

get-windowsfeature -name NET-* | uninstall-windowsfeature -whatif

As with installing components, the command output specifies if a restart is required to complete the task. If a restart is required to complete a removal, you can have Uninstall-WindowsFeature restart the computer by including the –Restart parameter.

If an error occurs and Uninstall-WindowsFeature is not able to perform the operation specified, you’ll see an error.
Other -----------------
- Windows Server 2012 : Configuring IPsec (part 7) - Configuring connection security rules - Monitoring IPsec
- Windows Server 2012 : Configuring IPsec (part 6) - Configuring connection security rules - Creating a custom rule, Configuring authenticated bypass
- Windows Server 2012 : Configuring IPsec (part 5) - Configuring connection security rules - Creating an authentication exemption rule, Creating a server-to-server rule, Creating a tunnel rule
- Windows Server 2012 : Configuring IPsec (part 4) - Configuring connection security rules - Types of connection security rules, Creating an isolation rule
- Windows Server 2012 : Configuring IPsec (part 3) - Configuring IPsec settings - Customizing IPsec tunnel authorizations, Configuring IPsec settings using Windows PowerShell
- Windows Server 2012 : Configuring IPsec (part 2) - Configuring IPsec settings - Customizing IPsec defaults
- Windows Server 2012 : Configuring IPsec (part 1) - Understanding connection security
- Microsoft Lync Server 2013 : Director Troubleshooting (part 3) - Synthetic Transactions,Telnet
- Microsoft Lync Server 2013 : Director Troubleshooting (part 2) - DNS Records, Logs
- Microsoft Lync Server 2013 : Director Troubleshooting (part 1) - Redirects, Certificates
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer