Microsoft Virtualization Discussions

HowTo process output of Get-NaCifs

skellner
3,984 Views

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

1 ACCEPTED SOLUTION

cknight
3,984 Views

Very simple:

PS C:\> $cifs = Get-NaCifs

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

View solution in original post

4 REPLIES 4

cknight
3,985 Views

Very simple:

PS C:\> $cifs = Get-NaCifs

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

JGPSHNTAP
3,984 Views

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"

}

cknight
3,984 Views

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

PS C:\> Invoke-NaSsh cifs resetdc

skellner
3,984 Views

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

Public