Server Management - Remote Server Management
1758638 Members
2160 Online
108874 Solutions
New Discussion

Using scripting to check if a MicroSD USB Kit is connected

 
CarlPowerNZ
Senior Member

Using scripting to check if a MicroSD USB Kit is connected

Hi peeps,

I have about 320x DL360 Gen10 servers, and about 160x ML30  Gen10 servers spread across 114,000sqkm, all managed with OneView 8.60.01.

We need to identify which of these servers have MicroSDUSB kits in them, ideally with a summary report, so we can have them removed on the next on site visit - powershell seems the most logical here.

Does anyone know how I might setup a script to identify which servers have these MicroSD USB kits in them?

I found a the OneView PS module, but it does not even show the SATA drives connected to the server...

2 REPLIES 2
Rama2
HPE Pro

Re: Using scripting to check if a MicroSD USB Kit is connected

Kindly use OneView admin credential to run PowerShell commands against your servers via OneView.

# Connect to the OneView appliance

Connect-HPOVMgmt -hostname <OneView_Appliance_IP> -username <username> -password <password>

# Get all servers managed by OneView

$servers = Get-HPOVServer

# Loop through each server to check for MicroSD USB kits

foreach ($server in $servers) {

    $serverHardware = Get-HPOVServerHardware -Name $server.name

    $serverHardwareComponents = Get-HPOVServerHardware -ServerHardware $serverHardware

    # Check if the server has MicroSD USB kits

    $microSDKit = $serverHardwareComponents | Where-Object { $_.Model -like "*MicroSD*" -and $_.Location -like "*USB*" }

    if ($microSDKit) {

        Write-Output "$($server.name) has MicroSD USB kit installed."

    } else {

        Write-Output "$($server.name) does not have MicroSD USB kit installed."

    }

}

# Disconnect from the OneView appliance

Disconnect-HPOVMgmt


I'm an HPE employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Sunitha_Mod
Moderator

Re: Using scripting to check if a MicroSD USB Kit is connected

Hello @CarlPowerNZ,

Let us know if you were able to resolve the issue.

If you have no further query and you are satisfied with the answer then kindly mark the topic as Solved so that it is helpful for all community members.

Thanks,
Sunitha G
I'm an HPE employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo