The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to register at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Microsoft Virtualization Discussions

Set-NaVolOption

JSHACHER11

hi Guys,

would this work:

+++++++++++++++++++

$vols = Get-Content c:\volumes.txt

Foreach ($vol in $vols)

{

Get-NaVol –Name $vol | Get-NaVolOption | ? {$_. fractional_reserve -ne 0} | Set-NaVolOption -Key fractional_reserve –Value 0

}

+++++++++++++++++

Thank you

1 ACCEPTED SOLUTION

JGPSHNTAP

Your updated script will not work.

Change $volume to $vol

I didn't test it all but in theory it should work fine. 

View solution in original post

6 REPLIES 6

JGPSHNTAP

That will not work.  Fractional_reserve is part of the name property.

Also, why are you dumping volumes from a file?  

I don't see you connecting to a controller either.. How you are planning on executing this,  That will determine how we can assist.

For example, what I would do

$hosts = gc c:\temp\filers.txt # list of filers

$hosts | % {

$Filer = $_

$c = connect-nacontroller $filer

$vols = Get-navol

$vols | % {

$volume = $_.name

if ((get-navoloption $volume | ? {$_.name -eq "fractional_reserve"}).value -ne 0)

{ set-navoloption $volume fractional_reserve 0

          }

     }

}

JSHACHER11

"why are you dumping volumes from a file? " - I've been asked to do a list of volumes

"I don't see you connecting to a controller either" - I would have used the 'connect-nacontroller' obviously. I did not forget that

thanks for the rest of the script = I'll try that

Let me know if you want to add anything

thank you

JSHACHER11

would this work?

++++++++++++++++++++++++++

$vols = Get-Content c:\volumes.txt

Foreach ($vol in $vols)

{

if ((get-navoloption $vol | ? {$_.name -eq "fractional_reserve"}).value -ne 0)

{ set-navoloption $volume fractional_reserve 0}

}

+++++++++++++++++++++++

JSHACHER11

I would also like to save a report of what exactly was done - something like a combination of -Verbose and Start-Transcript

is that possible?

thank you

JGPSHNTAP

Your updated script will not work.

Change $volume to $vol

I didn't test it all but in theory it should work fine. 

View solution in original post

JSHACHER11

it worked - thanks

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