Skip to main content
SnapCenter 6.0 cmdlets

Set-SmPolicy

Contributors

Modifies an existing policy.

Syntax

Set-SmPolicy [-PolicyName]  <String>  [-PolicyType]  <SmPolicyType>  [-PluginPolicyType]  <PluginCode>  [-Description]  <String>

Detailed Description

Modifies an existing policy.

Parameters

Name Description Required? Pipeline Input Default Value

PolicyName

Specifies the policy you want to change.

true

true (ByPropertyName)

PolicyType

Specifies the policy type. Valid value is Backup.

true

true (ByPropertyName)

PluginPolicyType

Specifies the type of plug-in. You need to specify a plug-in type because policies are settings that are specific to one type of plug-in.Valid plug-in policies types are SCSQL, SCO and HANA.

true

true (ByPropertyName)

Description

Specifies an optional description of the policy.

false

true (ByPropertyName)

UtmType

Type of up to the minute (UTM) retention settings to apply to log backups. Possible values are days and count.

false

true (ByPropertyName)

UtmCount

Up to the minute (UTM) retention by count.

false

true (ByPropertyName)

UtmDays

Up to the minute (UTM) retention by days.

false

true (ByPropertyName)

SqlBackupType

SQL backup type. Possible values are LogBackup, FullBackup, and FullBackupAndLogBackup.

true

true (ByPropertyName)

DatabasesPerGroup

Maximum number of databases in a group. This is applicable only for full backup.

false

true (ByPropertyName)

CopyOnlyBackup

Determines whether the full backup is a copy only backup.

false

true (ByPropertyName)

AGBackupType

Availability Group backup type. Possible values are UsePreferredBackupReplica and UseSpecifiedBackupReplica.

false

true (ByPropertyName)

AGBackupReplicaType

Availability Group backup replica type. Possible values are Primary, Secondary, and All.

false

true (ByPropertyName)

AGBackupPriorityMinimum

Availability Group backup minimum priority.

false

true (ByPropertyName)

AGBackupPriorityMaximum

Availability Group backup maximum priority.

false

true (ByPropertyName)

CreateLogFolderSnapshot

Create Log folder Snapshot copy.

false

true (ByPropertyName)

EnableLogFolderSnapshotRetention

Enable Log folder Snapshot copy retention.

false

true (ByPropertyName)

DeleteLogFolderSnapshotInExcess

Delete log folder Snapshot copies in excess of specified count. If other options are specified, then that will be ignored and only the log snapshot retention value will get modified.

false

true (ByPropertyName)

DeleteLogFolderSnapshotOlderThan

Delete log folder Snapshot copies that are older than specified days.

false

true (ByPropertyName)

VerifyLogBackup

Enable log backup verification after backup.

false

true (ByPropertyName)

DBCC_NOINDEX

DBCC options NOINDEX.

false

false

DBCC_ALL_ERRORMSGS

DBCC options ALL_ERRORMSGS.

false

true (ByPropertyName)

DBCC_NO_INFOMSGS

DBCC options NO_INFOMSGS.

false

true (ByPropertyName)

DBCC_TABLOCK

DBCC options TABLOCK.

false

true (ByPropertyName)

DBCC_PHYSICALONLY

DBCC options PHYSICALONLY.

false

true (ByPropertyName)

UpdateSnapMirrorAfterbackup

Update SnapMirror copy after backup. This option is not applicable for SAP HANA policy of File-Based Backup type.

false

true (ByPropertyName)

UpdateSnapVaultAfterbackup

Update SnapVault copy after backup. This option is not applicable for SAP HANA policy of File-Based Backup type.

false

true (ByPropertyName)

MirrorVaultUpdateRetryCount

Number of retries to ensure SnapMirror or SnapVault update is triggered.

false

true (ByPropertyName)

SnapVaultLabel

Label for SnapVault copy.

false

true (ByPropertyName)

AllowSavedStateBackup

Allow saved state backup.

false

true (ByPropertyName)

DeleteBackupInExcess

Delete backup in excess of specified days, it is applicable to only SnapCenter Plug-in for VMware vSphere, if it is used with other plug-ins it will be ignored.

false

true (ByPropertyName)

DeleteBackupOlderThan

Delete backups older than specified days, it is applicable to only SnapCenter Plug-in for VMware vSphere, if it is used with other plug-ins it will be ignored.

false

true (ByPropertyName)

PreScriptCommandVerification

false

true (ByPropertyName)

PreScriptArgumentsVerification

false

true (ByPropertyName)

PostScriptCommandVerification

false

true (ByPropertyName)

PostScriptArgumentsVerification

false

true (ByPropertyName)

ScriptTimeOutVerification

false

true (ByPropertyName)

ScheduleType

The schedule type. Possible values are None, Hourly, Weekly, Daily, and Monthly.

false

true (ByPropertyName)

RetentionSettings

Specifies in a hashtable the retention settings for the policy.

false

true (ByPropertyName)

PreScriptCommand

Prescript file UNC path with proper privileges for scripts accessibility, (‘\\\\server\\share\path\\file’ for Universal Naming Convention (UNC) names).

false

true (ByPropertyName)

PreScriptArguments

Specifies the prescript arguments.

false

true (ByPropertyName)

PostScriptCommand

Postscript file UNC path with proper privileges for scripts accessibility, (‘\\\\server\\share\path\\file’ for Universal Naming Convention (UNC) names).

false

true (ByPropertyName)

PostScriptArguments

Specifies the postscript arguments.

false

true (ByPropertyName)

ScriptTimeOut

Specifies script timeout value in seconds.

false

true (ByPropertyName)

VerificationScheduleType

Specifies when to run verification.

false

true (ByPropertyName)

DeleteCloneOnScheduleExpiry

Removes a clone during the last run of a scheduled job.If this parameter is not set, then the last run of a schedule also runs a clone life cycle and creates a cloned database.This parameter does not apply to jobs that are not scheduled or to one time job schedules.

false

true (ByPropertyName)

BackupPolicyName

Specifies the backup policy name.

true

true (ByPropertyName)

CloneType

Specifies the clone type. Possible values are Primary and Secondary.

false

true (ByPropertyName)

VerifyOnSecondary

Specifies whether to verify on Secondary or not.

false

false

NumOfBackups

Number of backups to be verified.

false

false

PluginParams

false

true (ByPropertyName)

DominoChangeInfoPath

false

true (ByPropertyName)

DominoDatabaseType

false

true (ByPropertyName)

DominoIniPath

false

true (ByPropertyName)

DominoRestoreFilePath

false

true (ByPropertyName)

DominoRestoreTime

false

true (ByPropertyName)

Lotus

false

true (ByPropertyName)

NotesExecDirectory

false

true (ByPropertyName)

DominoDisableReplication

false

true (ByPropertyName)

DominoIgnoreCorruptedDB

false

true (ByPropertyName)

DBMCliCmd

false

true (ByPropertyName)

HandleLogWriter

false

true (ByPropertyName)

MaxDBBGServerPrefix

false

true (ByPropertyName)

MaxDBUpdateHistLog

false

true (ByPropertyName)

SQLCliCmd

false

true (ByPropertyName)

XUserEnable

false

true (ByPropertyName)

DB2Cmd

false

true (ByPropertyName)

SybaseISQLCmd

false

true (ByPropertyName)

SybaseManifest

false

true (ByPropertyName)

SybaseManifestDelete

false

true (ByPropertyName)

SybaseManifestFormat

false

true (ByPropertyName)

SybaseTranDump

false

true (ByPropertyName)

SybaseTranDumpCompress

false

true (ByPropertyName)

SybaseTranDumpFormat

false

true (ByPropertyName)

OracleBackupType

Modifies the Oracle backup type. Type values are Online, Offline mount, and Offline shutdown.

true

true (ByPropertyName)

OracleBackupScope

Modifies the Oracle backup scope. This parameter is only valid when the backup type is Online. Backup scope values are Full, Data, and Log.

true

true (ByPropertyName)

OracleSkipPDBSaveState

Modifies the skip PDB save state. This parameter is only available when you select Offline shutdown backup type. Values are either True or False.

false

true (ByPropertyName)

DeleteAllArchiveLogs

Prunes (deletes) all archive logs after Full or Log backups.

false

true (ByPropertyName)

DeleteArchiveLogsOlderThan

Modifies the number of days before archive logs older than a specified number of days are pruned (deleted). This parameter supports the use decimals to enable you to specify a fraction of a day. For example, 2.5 represents 2 days and 12 hours, and 0.04 represents 1 hour.

false

true (ByPropertyName)

DeleteArchiveLogFromAllDestination

Modifies whether archive logs are pruned on all destinations or only on backed up destinations. If the value is True, archive logs are pruned on all destinations. If the value is False, archive logs are pruned only on backed up destinations.

false

true (ByPropertyName)

DeleteArchiveLogBackupInExcess

Modifies the number of archive log backups deleted in excess of the specified backup count.

false

true (ByPropertyName)

DeleteAchiveLogBackupOlderThan

Modifies the number of archive log backups deleted that are older than the specified number of days. This parameter supports the use decimals to enable you to specify a fraction of a day. For example, 2.5 represents 2 days and 12 hours, and 0.04 represents 1 hour.

false

true (ByPropertyName)

CatalogBackupWithOracleRMAN

false

true (ByPropertyName)

ScwBackupType

Specifies the type of SnapCenter for Windows backup. Valid values are CrashConsistent and FilesystemConsistent.

true

true (ByPropertyName)

SceBackupType

Specifies the backup type you want SnapCenter for Microsoft Exchange Plug-in to use.

true

true (ByPropertyName)

UtmCounts

false

true (ByPropertyName)

BackupTruncatedTransactionLog

false

true (ByPropertyName)

BackupActiveCopies

false

true (ByPropertyName)

BackupCopiesOnServer

false

true (ByPropertyName)

BackupType

This is a SAP HANA database specific parameter. Specifies the type of SAP HANA backup. The possible values are FileBasedBackup and SnapshotBasedBackup.

true

true (ByPropertyName)

Examples

Example 1: Modifying an existing Microsoft SQL policy

 Set-SmPolicy -PolicyName test -PluginPolicyType SCSQL -PolicyType Backup -SqlBackupType FullBackup -ScheduleType Hourly -DaysInterval 8 -StartTime $SystemTime -EndTime $SystemTimeExpire -SchedulerType SQL

This example syntax modifies an existing Microsoft SQL policy.

Example 2: Modifying an existing Oracle policy

 Set-SmPolicy -PolicyName 1 -PolicyType Backup -PluginPolicyType SCO -OracleBackupType ONLINE -OracleBackupScope FULL -DeleteAllArchiveLogs $true -DeleteArchiveLogFromAllDestination $true -DeleteArchiveLogBackupInExcess 5

Modifies an existing Oracle policy.

Example 3: Modifying an existing Windows backup policy

 Set-SmPolicy -PolicyName scw_policy3 -PolicyType Backup -PluginPolicyType SCW -ScwBackupType CrashConsistent

This example syntax modifies an existing Windows SCW policy.

Example 4: Modifying an existing SAP HANA backup policy of type SnapshotBasedBackup

 Set-SmPolicy -PolicyName hana_snapshotbased -PolicyType Backup -PluginPolicyType HANA -BackupType SnapShotBasedBackup -UpdateSnapMirrorAfterbackup $true -UpdateSnapVaultAfterbackup $true -SnapVaultLabel slabel

This example syntax modifies an existing SAP HANA backup policy of type SnapshotBasedBackup.

Example 5: Modifying an existing Microsoft SQL policy with SnapLock Retention

 Set-SmPolicy -PolicyName SCSQL_Snaplock_Policy -PluginPolicyType SCSQL -PolicyType Backup -SqlBackupType FullBackupAndLogBackup -ScheduleType Daily -retentionsettings @{"BackupType"="DATA"; "ScheduleType"="DAILY";"RetentionDays"="16";"SnapLockRetentionPeriod"=16;"SnapLockRetentionPeriodType"="Days"},@{"BackupType"="LOG"; "ScheduleType"="DAILY";"RetentionCount"="9";"SnapLockRetentionPeriod"=16;"SnapLockRetentionPeriodType"="Days"}

INFO: Specifying a retention period prevents the Snapshot copies from being deleted until the SnapLock retention period expires. This could lead to retaining a larger number of Snapshot copies than the count specified in the policy.

ApplySnapvaultUpdate: False
ApplyRetention  : True
RetentionCount  : 0
RetentionDays   : 16
ApplySnapMirrorUpdate   : False
SnapVaultLabel  :
MirrorVaultUpdateRetryCount : 3
Retentions  : {, , }
LastBackupStatus:
LastBackupDate  :
IncludeAcls :
AppPolicies : {}
Description :
PreScriptPath   :
PreScriptArguments  :
PostScriptPath  :
PostScriptArguments :
ScriptTimeOut   : 60
DateModified: 8/13/2023 6:56:10 PM
DateCreated : 8/13/2023 6:56:10 PM
Schedule: SMCoreContracts.SmSchedule
PolicyType  : Backup
PluginPolicyType: SMSQL
InBuilt : False
Schedules   : {}
AllowMultipleSchedules  : False
Name: SCSQL_Snaplock_Policy
Type:
Id  : 4
Host:
UserName:
Passphrase  :
Deleted : False
Auth: SMCoreContracts.SmAuth
IsClone : False
CloneLevel  : 0
Hosts   : {}
StorageName :
ResourceGroupNames  :
PolicyNames :
Key : 0
NsmObjectID : 0
SizeOfSmObject  : SMCoreContracts.SmObjectSize

Retention Settings
BackupType  : DATA
SchedulerType   : Daily
RetentionCount  : 0
RetentionDays   : 16
VerificationEnabled : False
NodeName:
SnapLockRetentionPeriod : 16
SnapLockRetentionPeriodType : Days

BackupType  : LOG
SchedulerType   : Daily
RetentionCount  : 9
RetentionDays   : 0
VerificationEnabled : False
NodeName:
SnapLockRetentionPeriod : 16
SnapLockRetentionPeriodType : Days

BackupType  : LOG_SNAPSHOT
SchedulerType   : None
RetentionCount  : 2
RetentionDays   : 0
VerificationEnabled : False
NodeName:
SnapLockRetentionPeriod :
SnapLockRetentionPeriodType :

Example 6: Modifying the Snapshot copy log retention

 Set-SMPolicy -PolicyName 'Log_policy_1' -PolicyType 'Backup' -Description 'log backup Policy'  -retentionsettings @{"BackupType"="DATA";"RetentionCount"="2"},@{"BackupType"="LOG";"RetentionCount"="2"},@{"BackupType"="LOG_SNAPSHOT";"RetentionCount"="3"} -pluginpolicytype 'SCSQL' -sqlbackuptype 'logbackup'

This example modifies the Snapshot copy log retention. When you change the retention setting, you must also specify the other cmdlet parameters, otherwise, the current settings will override the default settings.

Example 7: Modifying log snapshot copy retention value without resetting the other policy settings

 Set-SmPolicy -PolicyName 'test' -PolicyType Backup -PluginPolicyType 'SCSQL' -DeleteLogFolderSnapshotInExcess 2 -SqlBackupType 'fullbackupandlogbackup'

This example modifies the log snapshot copy retention value. If other policy options are specified then these options will be ignored and only retention value will be modified.