Hi Folk,
I'm trying to automate the closing/removing of CIFS file locks, and I'm running into problems with datat ypes.
In particular, I do a Get-NcCifsSessionFile which gives me a set of CIFSSessionFile objects, but when I try to pass the SessionID from one of those objects to the Close-NcCifsSessionFile it tells me value is too large for an INT64 (the close session applet is expecting an INT64, but the Get is returning a Decimal)
My code is essentially:
$SearchPath = "*CBR1PSCM01 TSM errors.xlsx"
# get a list of files open on cluster
$CIFSSessionFileTemplate = Get-NcCifsSessionFile -Template
$CIFSSessionFileTemplate.Path = $SearchPath
$Files = Get-NcCifsSessionFile -Query $CIFSSessionFileTemplate
foreach ($f in $FileList)
{
Close-NcCifsSessionFile -Node $f.Node -FileId $f.FileId -SessionId $f.SessionId -ConnectionId $f.ConnectionId
}
It I look at the type of the SessionId, it's decimal, and from what I see it IS too long for an INT64
#24 PS3 H:\> $f.SessionId.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Decimal System.ValueType
#23 PS3 H:\> Close-NcCifsSessionFile -Node $f.Node -FileId $f.FileId -SessionId $f.SessionId -ConnectionId $f.ConnectionId
Close-NcCifsSessionFile : Cannot bind parameter 'SessionId'. Cannot convert value "14120473681666951262" to type "System.Int64". Error: "Value was either too large or too small for an Int64."
I think this was working on an earlier version of OnTap, but it's not working with 9.2P1
NAS: ONTAP 9.2P1
Toolkit: V4.4 (DataONTAP module is 4.2.0)
PowerShell: 5.1
Is this a problem with the module?
(I'd be happy to know if there's another way to do it also!)
Cheers,
Stuart