Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! See The Solution
1 ACCEPTED SOLUTION
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your updated script will not work.
Change $volume to $vol
I didn't test it all but in theory it should work fine.
6 REPLIES 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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}
}
+++++++++++++++++++++++
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your updated script will not work.
Change $volume to $vol
I didn't test it all but in theory it should work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it worked - thanks