comma is interpreted as a list separator by PowerShell. Without double quotes, part of what should be a string is interpreted by PowerShell as a number. The operation of combined ranges is defined as creating a combination of each subnet address with each other subnet.

The following are examples of input range parameters using double quotes.

Range Parameter

Description

“192.168.1.1,15”

Specifies two addresses to check, 192.168.1.1 and 192.168.1.15.

“192.168.217,216.93,103”

Specifies four addresses to check, 192.168.217.93, 192.168.217.103,

 

192.168.216.93, 192.168.216.103.

“192.168.217,216.93-103”

Specifies twenty-two addresses to check, 192.168.217.93 through

 

192.168.217.103 and 192.168.216.93 through 192.168.216.103.

Piping output from one command to another

A useful feature of PowerShell is the ability to pipe output from one command to another. The preceding section provided examples of using Find-HPiLOto locate iLO devices. You may want to use those with other commands rather than input the iLOs you find again or store them somewhere and re-use them.

The following is a script that pipes output from Find-HPiLOthrough Add-Memberto add two required fields, and then to Get-HPiLOFirmwareVersionto produce the firmware version information for the iLOs found. The –Verboseparameter is used to view more information.

PowerShell script:

Find-HPiLO 192.168.217.97-103 -Verbose

%{Add-Member -PassThru -InputObject $_ Username admin}

%{Add-Member -PassThru -InputObject $_ Password admin123} Get-HPiLOFirmwareVersion -Verbose

Script output:

The following is typical output from this script.

Warning : It might take a while to search all the HP iLO servers if the input is a very large range. Use Verbose for more information.

VERBOSE: Using 7 threads for search.

VERBOSE: Pinging 192.168.217.97

VERBOSE: Pinging 192.168.217.98

VERBOSE: Pinging 192.168.217.99

VERBOSE: Pinging 192.168.217.100

VERBOSE: Pinging 192.168.217.101

VERBOSE: Pinging 192.168.217.102

VERBOSE: Pinging 192.168.217.103

VERBOSE: No iLO at 192.168.217.97

VERBOSE: No system responds at 192.168.217.99

VERBOSE: No system responds at 192.168.217.100

VERBOSE: No system responds at 192.168.217.101

VERBOSE: No iLO at 192.168.217.102

VERBOSE: Using 2 threads.

VERBOSE: Sending to 192.168.217.98 - ilo2m203100ld.company.net

VERBOSE: Sending to 192.168.217.103 - iloromqap8207bc.company.net

VERBOSE: Errors-0, Warnings-0, Total-2

IP

: 192.168.217.98

HOSTNAME

: ilo2m203100ld.company.net

STATUS_TYPE

: OK

STATUS_MESSAGE

: OK

FIRMWARE_DATE

: Jan 24 2013

FIRMWARE_VERSION

: 1.55

12 HP Scripting Tools for Windows PowerShell cmdlets

Page 12
Image 12
HP Scripting Tools for Windows PowerShell manual Piping output from one command to another, PowerShell script

Scripting Tools for Windows PowerShell specifications

HP Scripting Tools for Windows PowerShell is a powerful suite designed to enhance the management and automation of HP devices and services within a Windows environment. With a robust approach to system administration, it allows IT professionals and system administrators to streamline their workflows, manage resources more effectively, and reduce manual interventions.

One of the main features of HP Scripting Tools is the integration of HP's extensive hardware and software management capabilities into PowerShell. By leveraging PowerShell's scripting abilities, users can automate the configuration, monitoring, and reporting of HP devices at scale. This is particularly beneficial in enterprise settings, where managing a large fleet of devices can become cumbersome and prone to human error.

Among the technologies utilized by HP Scripting Tools is the HP Management Interface, which provides a comprehensive set of cmdlets tailored for handling various HP hardware components, such as servers, printers, and storage solutions. These cmdlets facilitate operations such as retrieving device status, updating firmware, and managing device configurations. This integration simplifies the process of interacting with HP hardware compared to traditional methods, enabling users to perform complex tasks with simple scripts.

Another critical characteristic of HP Scripting Tools is its emphasis on ease of use and accessibility. The tools provide detailed documentation and examples to guide users in writing scripts that address specific needs. Whether automating routine maintenance tasks or deploying configurations across multiple devices, users can rely on the resources provided to optimize their scripting efforts.

Furthermore, HP Scripting Tools supports the management of HP’s software solutions, including HP Smart Admin and HP System Software Manager. This allows for the central management of software updates and configurations, ensuring that systems remain up-to-date and secure with minimal effort.

Additionally, HP Scripting Tools promote collaboration by enabling scripts to be shared across teams, facilitating consistent administration practices. This collaborative environment ensures that best practices are followed and reduces the redundancy of script-writing efforts.

In conclusion, HP Scripting Tools for Windows PowerShell is an invaluable asset for organizations utilizing HP devices, offering essential features to automate management tasks, enhance operational efficiency, and optimize resource utilization. With its powerful cmdlets and seamless integration into PowerShell, it empowers IT professionals to take full control of their HP equipment in a more productive and efficient manner.