Microsoft Virtualization Discussions

HowTo process output of Get-NaCifs

skellner

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

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

Very simple:

PS C:\> $cifs = Get-NaCifs

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

View solution in original post

JGPSHNTAP

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

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

PS C:\> Invoke-NaSsh cifs resetdc

skellner

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

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public