Hello All,
I am working with NetApp for few years but I never had the chance to work on Powershell before. I had been trying to get started with NetApp Powershell module for few days. I am able to connect to filers individually and run few cmdlets. But if I am having issues in connecting to multiple filers at once and list system info by using foreach loop in my profile. But surprisingly the same profile is working fine at times. By saying working , I am not getting any output but it runs without throwing any errors. You can see the loop I am talking about below:
foreach ($filer in $allfilers){
#connect to the storage system
Connect-NaController $filer -Credential $authentication
echo "Connecting to $filer"
echo "--------------"$filer"-------------"
get-nasysteminfo
}
In the above loop, should I give a pause or anything in order to get the filer info? But I am getting errors at most of the times which are shown below:
Connect-NaController : Object reference not set to an instance of an object.
At D:\Data\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:20 char:21
+ Connect-NaController <<<< $filer -Credential $authentication
+ CategoryInfo : InvalidResult: (filer1:NaController) [Connect-NaController], NullReferenceException
+ FullyQualifiedErrorId : HttpConnectionFailed,DataONTAP.PowerShell.SDK.ConnectNaController
Get-NaSystemInfo : Value in $global:CurrentNaController is not of type NetApp.Ontapi.Filer.NaController
At D:\Data\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:23 char:17
+ get-nasysteminfo <<<<
+ CategoryInfo : InvalidArgument: (
[Get-NaSystemInfo], ArgumentException
+ FullyQualifiedErrorId : ControllerNotSpecified,DataONTAP.PowerShell.SDK.Cmdlets.System.GetNaSystemInfo
Connect-NaController : Object reference not set to an instance of an object.
At D:\Data\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:20 char:21
+ Connect-NaController <<<< $filer -Credential $authentication
+ CategoryInfo : InvalidResult: (filer2:NaController) [Connect-NaController], NullReferenceException
+ FullyQualifiedErrorId : HttpConnectionFailed,DataONTAP.PowerShell.SDK.ConnectNaController
Any information in this regard would be really helpfull. Thank you very much in advance.
Thanks,
MD.