Microsoft Virtualization Discussions

Possible bug with close-nccifssession

JGPSHNTAP
4,632 Views

I'm not quite sure what is going on here, but this should be simple pipeline to close-nccifssession

 

First we see this

 

PS C:\powershell> get-nccifssession | ? {$_.windowsuser -match "userid"} | close-nccifssession -confirm:$false
close-nccifssession : Parameter 'SessionId' is mandatory for Data ONTAP 9.0 and up.
At line:1 char:61
+ ... windowsuser -match "userid"} | close-nccifssession -confirm:$false
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (filer:NcController) [Close-NcCifsSession], ArgumentException
+ FullyQualifiedErrorId : SessionIdRequired,DataONTAP.C.PowerShell.SDK.Cmdlets.Cifs.CloseNcCifsSession

 

Then we try this

 


PS C:\powershell> close-nccifssession -SessionId 13404964290887995043
Close-NcCifsSession : Cannot bind parameter 'SessionId'. Cannot convert value "13404964290887995043" to type "System.Int64". Error: "Value was
either too large or too small for an Int64."
At line:1 char:32
+ close-nccifssession -SessionId 13404964290887995043

 

This has to be some sort of bug  

5 REPLIES 5

darraghos
4,604 Views
Too big to convert I'm afraid: PS C:\WINDOWS\system32> [int64]::MaxValue 9223372036854775807 13404964290887995043 is longer by 1 char and exceeds the range. POwershell is working fine but it seems like the cmdlet has not accounted for the sessionID being longer. One way around it would likely be to use powershell with one of the invoke cmdlets to run the command at the cluster head.

JGPSHNTAP
4,550 Views

I forgot to mention that I already knew it was 1 digit bigger than max value.  I checked that as well. That was my first run at this.

 

Invoke-ncssh works, but is not nearly as easy as passing the pipeline.

 

I think the team needs to fix this.. maybe pass as string..

JGPSHNTAP
4,543 Views

Perhaps the cmdlet for sessionid needs to be changed from int64 to decimal

 

PS C:\powershell> [decimal]13404964290887995043
13404964290887995043
PS C:\powershell> [decimal]13404964290887995043 | gm


TypeName: System.Decimal

 

 

asulliva
4,539 Views

There is already a bug (1142906) open on this : )

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

JGPSHNTAP
4,524 Views

Andrew.. How funny.. I should have searched!

 

Duh... Thanks for helping me search.. and was nice to meet you

Public