Microsoft Virtualization Discussions

storage inventory

naveens17

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

2 REPLIES 2

Shashanka

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  
}

billyd
See if you have access to this link with your NetApp account. It's an installation for NetAppDocs which will provide you everything you are looking for (and more) in either Word or Excel format. http://mysupport.netapp.com/tools/info/ECMP12505953I.html?productID=62107
Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public