Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
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
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..
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
There is already a bug (1142906) open on this : )
Andrew
Andrew.. How funny.. I should have searched!
Duh... Thanks for helping me search.. and was nice to meet you