Subscribe
Accepted Solution

HowTo process output of Get-NaCifs

I want to check if a vfiler has an active dc connection. If it has not I want to do a resetdc. My Question is how I can process the output of Get-NaCifs. So if I get

PS D:\wfa> Get-NaCifs

ADSite            : v998xs48

AuthType          : ad

DCConnection      :

DNSDomainname     : v998dpv1.v998.intern

LDAPConnection    : {NetApp.Ontapi.Filer.Cifs.ConnectionInfo}

NetBIOSDomainname : V998DPV1

NetBIOSServername : V998SPNVV1888GL

SecurityStyle     : multiprotocol

WindowsType       : Windows 2003

As I'm new to powershell I don't know how to get the output into a variable. In my particular case I would check if DCConnection is empty like in this case. Any help with this is appreciated. Thanks in advance.

Stefan

Re: HowTo process output of Get-NaCifs

Very simple:

PS C:\> $cifs = Get-NaCifs

PS C:\> if ($cifs.DCConnection -eq $null) { Write-Host "No DC connection" }

Re: HowTo process output of Get-NaCifs

Clinton -

He bring's up a good point, I read the man page, I don't see any options in cifs to run "resetdc"

would you have to connect to the filer via https and then have this code

$cifs = get-nacifs

if ($cifs.DCConnectoin -eq $null) {

invoke-nassh -command "cifs resetdc"

}

Re: HowTo process output of Get-NaCifs

Yes, it appears you'll have to use SSH to do that:

PS C:\> Invoke-NaSsh cifs resetdc

Re: HowTo process output of Get-NaCifs

That's exactly how I implemented it. Thanks for your initial hint.