troubleshooting Question

Powershell Gurus - Please Help

Avatar of syseng007
syseng007 asked on
Powershell
3 Comments1 Solution1199 ViewsLast Modified:
Need help on tweaking the attached Powershell code. I need to find HBA and WWN storage info from a list of servers, and output it in a Excel worksheet. Please help! Thank you.

function Get-HBAWin {
param(
[String[]]$ComputerName = $ENV:ComputerName  
)
 
$ComputerName | ForEach-Object {
$Computer = $_
$Namespace = "root\WMI"  
Get-WmiObject -class MSFC_FCAdapterHBAAttributes -computername $Computer -namespace $namespace |
ForEach-Object {
$hash=@{
ComputerName     = $_.__SERVER
NodeWWN          = (($_.NodeWWN) | ForEach-Object {"{0:x}" -f $_}) -join ":"
Active           = $_.Active
DriverName       = $_.DriverName
DriverVersion    = $_.DriverVersion
FirmwareVersion  = $_.FirmwareVersion
Model            = $_.Model
ModelDescription = $_.ModelDescription
}
New-Object psobject -Property $hash
}#Foreach-Object(Adapter)
}#Foreach-Object(Computer)
 
}#Get-HBAWin
ASKER CERTIFIED SOLUTION
Qlemo
"Batchelor", Developer and EE Topic Advisor
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros