Hi Victor,
Is it possible there is a typo in the volume name based on the error 'no such file or directory'?
Do you still get the same error if you verify that the volume and snapshot exist?
$VolumeName = "victor_2019_test"
$VserverName = "soxdurhio01a01"
$Cluster = "durarcclu01"
$SnapshotName = "daily.2020-06"
$Credential = Get-NcCredential
If($Null -eq $Credential){
Write-Warning -Message "You must provide credentials to connect to cluster ""$Cluster"""
Break;
}
Import-Module DataONTP
Connect-NcController -Name $Cluster -HTTPS -Credential $Credential -ErrorAction Stop
$volume = Get-NcVol -Name $VolumeName -Vserver $VserverName -ErrorAction Stop
If($Null -eq $volume){
Write-Warning -Message "The volume ""$VolumeName"" was not found on vserver ""$VserverName"""
Break;
}
$snapshot = Get-NcSnapshot -Volume $VolumeName -SnapName $SnapshotName -Vserver $VserverName -ErrorAction Stop
If($Null -eq $snapshot){
Write-Warning -Message "The snapshot ""$SnapshotName"" does not exist on volume ""$VolumeName"" on vserver ""$VserverName"""
Break
}
Set-NcSnapshotSnaplockExpTime -volume $VolumeName -Snapshot $SnapshotName -Expirytime $(Get-Date -Date '06/14/2020') -Vserver $VserverName -ErrorAction Stop
/Matt
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.