Microsoft Virtualization Discussions

Get-NcCifsSessionFile : There is an error in XML document

JRN1
693 Views

Hi,

 

if I write the output from Get-NcCifsSessionFile in variable I got often the XML error message.

 

Any suggestion to solve the error?

DataOntap 9.8.0

 

$OpenFilesNC = Get-NcCifsSessionFile  -VserverContext  $srv  | Select Vserver,Share,ShareMode,OpenMode,Path,FileId

 

Error:
Get-NcCifsSessionFile : There is an error in XML document (1, 6000).
At
+ ... $OpenFilesNC = Get-NcCifsSessionFile -VserverContext $srv |Select ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (.............. :NcController) [Get-NcCifsSessionFile], InvalidOperationException
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Cifs.GetNcCifsSessionFile

1 ACCEPTED SOLUTION

hmoubara
561 Views

Hello

I was able to get your variable to work as is, but i have to use command: Invoke-expression to get it to work.

Per example:

Get-variable -Name test:

Get-NcCifsSessionFile -VserverContext svm1_cluster1 | Select vserver,share,sharemode,openmode,path,fileid

PS> Invoke-expression $test

 

View solution in original post

4 REPLIES 4

hmoubara
572 Views

Hello @JRN1 

 

Can you confirm if you are able to run the command outside of the variable without any issue?

 

Thanks

JRN1
564 Views

Hello @hmoubara ,

 

yes I can confirm.

 

I found a way today. If I run it for specific share it works without error.

 

Have to use "-Query" because no "-Share" is available.

 

$OpenFilesNC = Get-NcCifsSessionFile -Query @{ Share = $ShareName} |Select Vserver,Share,ShareMode,OpenMode,Path,FileId

 

Thanks

hmoubara
562 Views

Hello

I was able to get your variable to work as is, but i have to use command: Invoke-expression to get it to work.

Per example:

Get-variable -Name test:

Get-NcCifsSessionFile -VserverContext svm1_cluster1 | Select vserver,share,sharemode,openmode,path,fileid

PS> Invoke-expression $test

 

JRN1
553 Views

Hi thanks for finding that out. 

Both solutions looks  to work.

Public