The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to reigister 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.

ONTAP Discussions

Unable to connect to filer due to incorrect credentials for server. have only windowaccess to shares

Anu1234

param([string]$paNetAppHost, [string]$pausername)

Import-module DataOnTap

$PathtoCSV = "C:\NetappTotalVolume.csv"

#Connect to filer

Connect-NAController $pafileshare –cred $pausername

$allvolumesnames = get-navol | Select-Object Name,Available

#set headers of CSV file

"VolumeName,Available Space(GB),Used Space(GB),Total Volume Space(GB)" > $PathtoCSV

foreach ($netapp_vol in $allvolumesnames) {

$CurrentVolname = $netapp_vol.name

$VolumesAvailable = $netapp_vol.available

$VolumeSizeTotal = get-navolsize -name $CurrentVolname | Select-Object -ExpandProperty VolumeSize

#Convert to GB

$VolumeAvailable1GB = ($VolumesAvailable / 1GB)

$VolumeSizeTotal1GB = ($VolumeSizeTotal / 1GB)

#Calc usedspace

$VolumeUsedSpace1GB = $VolumeSizeTotal1GB - $VolumeAvailable1GB

#Create/add to CSV file

$Combine = $CurrentVolname,$VolumeAvailable1GB,$VolumeUsedSpace1GB,$VolumeSizeTotal1GB

$Combine -join "," >> $PathtoCSV

}

4 REPLIES 4

Anu1234

we don't have admin access to file server. we just only map the shares. so. iwould like to get the volume of each folder under the file share. 

Thanks in Advance

GidonMarcus

Hi

 

sorry, the question is not clear. can you add any error message or example for the result you want to achieve?

 

Gidi

Gidi Marcus (Linkedin) - Storage and Microsoft technologies consultant - Hydro IT LTD - UK

Anu1234

The following error I am getting after running the above code. 

we only have windows access to file shares not admin access to file shares.

 

Thanks in advance


Connect-NaController : Incorrect credentials for usalbfs33-181.am.health.ge.com.
At line:9 char:1
+ Connect-NaController usalbfs33-181.am.health.ge.com –cred $pausername
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (usalbfs33-181.am.health.ge.com:NaController) [Con
nect-NaController], NaAuthException
+ FullyQualifiedErrorId : HttpConnectionFailed,DataONTAP.PowerShell.SDK.ConnectNaController

get-navol : Value in $global:CurrentNaController is not of type NetApp.Ontapi.Filer.NaController
At line:11 char:20
+ $allvolumesnames = get-navol | Select-Object Name,Available
+ ~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-NaVol], ArgumentException
+ FullyQualifiedErrorId : ControllerNotSpecified,DataONTAP.PowerShell.SDK.Cmdlets.Volume.Ge
tNaVol

out-file : Access to the path 'C:\NetappTotalVolume.csv' is denied.
At line:15 char:1
+ "VolumeName,Available Space(GB),Used Space(GB),Total Volume Space(GB) ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], UnauthorizedAccessException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

SpindleNinja

You will need access to the system that's running these CIFS shares,  readonly should be enough.   This PS is designed to run netapp ONTAP commands to gather data and output to a CSV.      Volumes to shares don't always have a 1 to 1 ratio either.   There are times when you can have 20 shares off various qtrees map all within a single volume.   

 

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