NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Microsoft Virtualization Discussions

HowTo process output of Get-NaCifs

skellner
6,064 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
6,064 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
6,065 Views

Very simple:

PS C:\> $cifs = Get-NaCifs

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

JGPSHNTAP
6,064 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
6,064 Views

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

PS C:\> Invoke-NaSsh cifs resetdc

skellner
6,064 Views

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

Public