Quantcast
Channel: ONTAP Discussions topics
Viewing all articles
Browse latest Browse all 4944

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

$
0
0

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

}


Viewing all articles
Browse latest Browse all 4944

Trending Articles