get-ncsnapshot against 9.1 cluster with 200K snapshots

I'm trying to speed up the process of acquiring the "Created" field on each snapshot returned from get-ncsnapshot. It currently takes many hours to return a generic get-ncsnapshot against a Ontap 9.1P2 cluster with >200K snapshots.

I've tried the following:

$snaptemplate = get-ncsnapshot -Template

get-ncsnapshot -Attributes $snaptemplate

While this does yield significant performance improvements, it doesn't include the "Created" property.

I can't initialize-ncobjectproperty against created as it's an alias for AccessTimeDT. I can't initialize AccessTimeDT as it's read-only as follows:

Re: get-ncsnapshot against 9.1 cluster with 200K snapshots

The problem is that AccessTimeDT is not a property being returned from ZAPI, but rather is a calculated property coming from the toolkit. You can use your current method but initialize the AccessTime property instead and then calculate the DT property yourself (you can use the cmdlet 'ConvertTo-DateTime -Seconds $_.AccessTime' to calculate the DT property).

Re: get-ncsnapshot against 9.1 cluster with 200K snapshots

I find it easier to use the hash notation for these types of attribute limit examples...

Get-NcSnapshot -Attributes @{ AccessTime = "" }

The AccessTime is turned into a PowerShell DateTime object by PSTK and accessed using hte AccessTimeDT property of the resulting object. That's why it doesn't recognize it when trying to limit the attributes returned.

Hope that helps.

Andrew

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