After long months of hard work, I am excited to announce the release of my new PowerShell library for HPE Compute Ops Management. This comprehensive library offers a robust set of cmdlets designed to manage and automate your HPE GreenLake environment efficiently. By leveraging this library, users can seamlessly interact with HPE GreenLake and Compute Ops Management services directly from the PowerShell command line, integrating effortlessly into existing automation workflows.

Development is ongoing, and my efforts are far from finished. As we all know, SaaS cloud applications evolve over time. Therefore, this library will be continuously updated to incorporate new features as they are released by HPE.

This module is available in the PowerShell Gallery under the name HPECOMCmdlets, following the naming convention used by most HPE modules.

The PowerShell Gallery is a repository for sharing and distributing PowerShell modules and scripts. It’s a community-driven platform that provides access to various PowerShell resources, enabling you to easily discover, install, and publish your own PowerShell content. The PowerShell Gallery can be accessed through the PowerShellGet module (includes Install-Module, Find-Module, etc.), which comes pre-installed with Windows PowerShell 5.0 and above.

This project is also associated with a new repository on my GitHub account. This repository is where the source code is developed. You can also track releases, report and view issues, and participate in discussions.

Key Features

This library provides a variety of key features for managing HPE GreenLake and Compute Ops Management. Here are the main features:

  • Authentication: Connect to HPE GreenLake using single-factor authentication with or without an existing workspace.
  • Workspace Management: Create and manage HPE GreenLake workspaces.
  • Session Tracking: Automatically track sessions with the global session tracker $HPEGreenLakeSession.
  • User Management: Invite and manage users within your HPE GreenLake environment, assign roles.
  • Resource Management: Manage resources such as servers, storage, and networking within your HPE GreenLake environment.
  • Service Provisioning: Provision services like Compute Ops Management, manage service roles and subscriptions.
  • Device Management: Add devices individually or in bulk using CSV files, manage device subscriptions and auto-subscriptions, set device locations and connect devices to services.
  • Server configuration Management: Create and apply BIOS, storage, OS, and firmware settings. Manager group and apply configurations to groups of servers.
  • Security and Compliance: Manage iLO security settings and run inventory and compliance checks.
  • Job Scheduling and Execution: Schedule and execute various tasks like firmware updates, OS installations, and sustainability reports.
  • Notification and Integration: Enable email notifications for service events and summaries, integrate with external services like ServiceNow.
  • Appliance Management: Add HPE OneView and Secure Gateway appliances, upgrade HPE OneView appliances.
  • Monitoring and Alerts: Monitor alerts for your resources to ensure optimal performance and uptime.
  • Reporting: Generate detailed reports on resource usage, performance, and other metrics.
  • Automation: Automate repetitive tasks and workflows using PowerShell scripts and cmdlets.
  • Integration: Seamlessly integrate with other tools and platforms using REST APIs and webhooks.
  • Security: Implement security best practices and manage access control for your HPE GreenLake environment.

These features collectively provide a comprehensive set of cmdlets to manage various aspects of your HPE GreenLake environment and any existing Compute Ops Management service instances.

Requirements

  • PowerShell Version: 5.1 or higher
  • Supported PowerShell Editions: Desktop, Core
  • HPE Account: Required to connect to the HPE GreenLake platform and any Compute Ops Management services

Note: If you do not have an HPE Account, you can create one here. To learn how to create an HPE account, see Getting started with HPE GreenLake.

Note: To interact with an HPE GreenLake workspace and a Compute Ops Management instance, you must have at least the Observer role for both HPE GreenLake Platform and Compute Ops Management service managers. This role grants view-only privileges. For modification capabilities, you need either the Operator (view and edit privileges) or the Administrator (view, edit, and delete privileges) role. Alternatively, you can create a custom role that meets your specific access requirements.

Note: The library supports only single-factor authentication. Multi-factor authentication (MFA) and SAML Single Sign-On are not supported. Users who use SAML Single Sign-On with HPE GreenLake cannot use their corporate email credentials when logging in via the Connect-HPEGL cmdlet. The workaround is to create a specific user in HPE GreenLake for this library. To do this, go to the HPE GreenLake GUI, click on User Management in the quick links panel and press the Invite Users button to send an invitation to a non-corporate email address. Once you receive the email, accept the invitation, and you will be directed to the HPE GreenLake interface to set a password. You can then use this email address and password to log in with Connect-HPEGL.

Note: You do not need an existing HPE GreenLake workspace to connect. You can create a new workspace after your first connection using the New-HPEGLWorkspace cmdlet.

Installation

To install the library, download the module and import it into your PowerShell session:

Install-Module HPECOMCmdlets

This will download and install the module from the official PowerShell Gallery repository. If this is your first time installing a module from the PowerShell Gallery, it will ask you to confirm whether you trust the repository or not. You can type Y and press Enter to continue with the installation.

Note: You must have an internet connection to install the module from the PowerShell Gallery.

Note: This library has no dependencies, so it does not require the installation of any other software or modules to function properly.

Note: You may encounter several issues while using the Install-Module cmdlet in PowerShell, including:

  • Insufficient Permissions: You might need administrative privileges to install modules. If you lack these privileges, run your PowerShell client as an administrator or use: Install-Module HPECOMCmdlets -Scope CurrentUser.
  • Blocked Security Protocols: PowerShell’s security settings can sometimes block the installation process, especially if the execution policy is set to Restricted. If Get-ExecutionPolicy returns Restricted, run Set-ExecutionPolicy RemoteSigned to change it.

Getting Started

To get started, create a credentials object using your HPE GreenLake user’s email and password and connect to your HPE GreenLake workspace:

$credentials = Get-Credential
Connect-HPEGL -Credential $credentials -Workspace "YourWorkspaceName"

If you don’t have a workspace yet, use:

Connect-HPEGL -Credential $credentials 

If you have multiple workspaces assigned to your account and are unsure which one to connect to, use:

Connect-HPEGL -Credential $credentials 
# Get the list of workspaces
Get-HPEGLWorkspace 
# Connect to the workspace you want using the workspace name
Connect-HPEGLWorkspace -Name "<WorkspaceName>"

These commands establishe and manage your connection to the HPE GreenLake platform.

Upon successful connection, it creates a persistent session for all subsequent module cmdlet requests.

Additionally, the cmdlet generates temporary API client credentials for both HPE GreenLake and any Compute Ops Management service instances provisioned in the workspace.

The global variable $HPEGreenLakeSession stores session information, API client credentials, API access tokens, and other relevant details for both HPE GreenLake and Compute Ops Management APIs.

To learn more about this object, refer to the help documentation of Connect-HPEGL.

Script Samples

To help you get started quickly, I have provided a sample script.

This file contains a variety of examples demonstrating how to use the different cmdlets available in the library to accomplish various tasks.

With HPE GreenLake:

  • Setting up credentials and connecting to HPE GreenLake
  • Configuring workspace, inviting new users and assigning roles
  • Provisioning services and managing device subscriptions
  • Adding devices individually or via CSV files

With HPE Compute Ops Management:

  • Creating BIOS, internal storage, OS, and firmware settings.
  • Managing group and adding servers to groups.
  • Running inventory jobs and setting auto firmware updates.
  • Powering on servers and updating firmware.
  • Applying configurations and installing OS on servers.
  • Generating sustainability reports and enabling email notifications.
  • Adding external services like ServiceNow.
  • Managing and upgrading HPE OneView and Secure Gateway appliances.

Feel free to modify and expand upon these examples to suit your specific needs. This file is an excellent starting point for understanding the capabilities of the module and how to leverage it in your automation workflows.

Getting help

For more detailed information on each cmdlet and its usage, refer to the module’s help documentation using:

Get-Help <CmdletName> -full

To see detailed examples of how to use a specific cmdlet, use the Get-Help cmdlet with the -Examples parameter followed by the cmdlet name.

Get-Help <CmdletName> -Examples

To list all commands exported by the module, use:

Get-Command -Module HPECOMCmdlets

To find cmdlets related to a specific resource, use:

Get-Command -Module HPECOMCmdlets | ? Name -match "<ResourceName>" 
# Example
Get-Command -Module HPECOMCmdlets | ? Name -match group

Support

If you encounter any issues or unexpected behavior, please open a new issue on my GitHub issue tracker for assistance.

For general questions or discussions that don’t require tracking, join our GitHub Discussions.

Disclaimer

Please note that the HPE GreenLake APIs are subject to change. Such changes can impact the functionality of this library. We recommend keeping the library updated to the latest version to ensure compatibility with the latest API changes.

Want more?