Microsoft Virtualization Discussions

Get-NcCifsSessionFile only retur a result of 100 entries

ssg
4,354 Views

Hi,

I can't figure out how to get the command Get-NcCifsSessionFile to retur more then 100 entries. I hope that one of you point me in the right direction

Kind regards

Soren Schriver Gildborg

3 REPLIES 3

beam
4,354 Views

Thank you for reporting this.  It appears that only the first iteration is returning results, so the max number of files returned is limited by the max records returned in a single iteration.  You can work around this by temporarily increasing the max iter records value on the NcController object .  For example:

PS C:\Users\Administrator> $global:CurrentNcController.MaxIterRecords

100

PS C:\Users\Administrator> (Get-NcCifsSessionFile).Length

100

PS C:\Users\Administrator> $global:CurrentNcController.MaxIterRecords = 250

PS C:\Users\Administrator> (Get-NcCifsSessionFile).Length

159

Thanks!

Steven

ssg
4,354 Views

Hi Steven,

Thanks for your respons.

If I set $global:CurrentNcController.MaxIterRecords to 9999 I only get 1000 items returned although I know that there are more then 1000 open files on the CIFS vserver.

The powershell script that I ran look like this:

Import-Module DataONTAP

Connect-NcController "VSERVERNAME" -HTTPS -Credentiald "USERNAME"

$global:CurrentNcController.MaxIterRecords = 9999

(Get-NcCifsSessionFile).Length

And the result was a 1000 items.

What I am trying to achieve is to return all open files on the CIFS vserver so I can make a search for how many that have particular file open.

Do you have any suggestions on how I can get past the 1000 items limit?

Kind regards,

Soren

beam
4,354 Views

Soren,

There is a max number of records that can be returned.  Unfortunately, until this is fixed, you won't be able to get more than that max for this particular cmdlet.  However, I think you can use the querying ability of this cmdlet to greatly reduce the number of records you need to look through.  Check out the examples for Get-NcCifsSessionFile for an example on how to use the query parameter.

For example, if you know the path of the file you want to check, specify the Path property on the query object.  You can also use the Share property to limit the results to one or more shares.  As always, you can use wildcards when specifying values in the query object.

Thanks,

Steven

Public