Microsoft Virtualization Discussions

Need to get efficiency details and autogrow details using powershell in cluster mode NetApp

ARB
4,185 Views

Hello All,

 

Need to get details of efficiency and autogrow features using powershell from multiple controller  in excel sheet

 

sample output from cluster mode NetApp

 

Vserver Volume State Status Progress Policy
---------- ---------------- -------- ------------ ------------------ 
 

test test_root Enabled Idle Idle for 00:56:05 -
test2 test2_root Enabled Idle Idle for 00:56:05 -
test3 test3_root Enabled Idle Idle for 00:56:04 -

6 REPLIES 6

asulliva
4,150 Views

Hello @ARB,

 

Can you be more specific about what you're looking for in the output?  What you've provided appears to be a truncated version of the output from "Get-NcSis" (maybe from a 7-mode system?).

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

ARB
4,109 Views

Hello Asuvilla,

 

I have figured that out by checking one of your post. 

 

current requirement is to pull all the output through powershell and generate an excel sheet and put those records in the same format without  any manual intervention.

 

Ex:

suppose we have 15-20 fields which we are pulling and sending it to excel even if I use autosize and other format table commands it gives me an output which needs to have manual intervention in excel to do 'text to column" since I use "out-file <excel_file.xls> location.

 

with the above approach if there are more records using "text to column" doesn't segregate the details properly

 

Hence please suggest if the records can be pushed into excel without any manual intervention in the same format as it shows in the pwershell console.

 

NOTE: If the records are less, then "text to columns" works fine but when we have more records and try to do it using "space" as seperator then it fails

 

 

nccontroller  vserver vol_name auto_grow_status  auto_grow_size 

 

asulliva
4,092 Views

Have you tried using the Convertto-Csv and/or Export-Csv cmdlets to get the data into something Excel can use?

 

Get-NcSis | Export-Csv .\temp.csv -NoTypeInformation 

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

ARB
4,081 Views
Yes . but using CSV format the output doesnt come as it shows in power shell . rather it shows the output in some weird alphanumeric values.

Moreover is there a way to convert the CSV exactly same output into an excel

asulliva
4,048 Views

This is because it outputs the entire object instead of just the fields which are displayed.  You can force that behavior by piping to Select-Object...

 

 

Get-NcSis | Select-Object Path,State,Status,ScheduleOrPolicy,Progress | ConvertTo-Csv -NoTypeInformation

 

 

I'm not sure what you mean by your latter statement: "is there a way to convert the CSV exactly same output into an excel."  Excel should handle the CSV and import the columns/rows into cells as expected.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

ARB
4,006 Views

Hello Asulliva,

 

Tried the convert-csv but doesn't yield the desired output. CSV format converts the output and same output is being imported in excel. Please see the details below.

 

 

NcControllerVserverNameAuto_grow_statusMax_Size(MB)Inc_Size(MB)ModeAuto_Grow_Thres_Perc 
--------------------------------------------------------------------------------------- 
CM_Remtesttest_rootFALSE241off85 
CM_Remtest2test2_rootFALSE241off85 
CM_Remtest3test3_rootFALSE241off85 
         

 

where as in convert-csv it shows the details as follows

 

"ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry"
"033ecb2bc07a4d43b5ef94ed5a35d280",,,"Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfo","Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo",
"9e210fe47d09416682b841769c78b8a3",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"4ec4f0187cb04f4cb6973460dfe252df",,,,,
"cf522b78d86c486691226b40aa69e95c",,,,,

 

When I try to import the details in excel it comes in the same format which is pasted below

Public