2016-08-25 12:09 PM
what is the best way to write a script for 7 mode and cdot in powershell for collecting the netapp inventory details like.. version,hardware model,storage shelf model,serial number and format into a excel file ....
any help will be much appreciated... Thanks
2016-08-26 12:16 PM
2016-08-29 01:44 AM
You can try the below piece of script (Customize the values according to your needs)
# Get the nodes $nodes = (Get-NcNode).Node # Clear the contents of CSV Files If(Test-Path C:\node.csv) {Clear-Content C:\node.csv} If(Test-Path C:\shelf.csv) {Clear-Content C:\shelf.csv} # Get the Node info in a CSV file (Get-NcNode) | Select-Object Node, NodeModel, NodeSerialNumber, NodeSystemId, ProductVersion | Export-Csv C:\node.csv # Get the shelf info for all the nodes in a CSV file for ($i=0; $i -lt (Get-NcNode).count; $i++) { Get-NcShelf -NodeName $nodes[$i] | Select-Object NcController, NodeName, ShelfId, ShelfName, ShelfState, ShelfType, ShelfBayCount | Export-Csv C:\shelf.csv -Append }