Skip to content

Latest commit

 

History

History
175 lines (128 loc) · 6.23 KB

README_old.md

File metadata and controls

175 lines (128 loc) · 6.23 KB

PPDM-pwsh

ppdm19 6

❤️ Powershell Modules for DellEMC PowerProtect DataManager API ❤️

🌅 This is the 19.14 Vesrion 🌅

installing the Module

the module should be installed from PSgallery

Install-Module -Name PPDM-pwsh	-MinimumVersion 19.14.0.20

😛 Install the Pre-Release Version:

Install-Module PPDM-pwsh -AllowPrerelease -MinimumVersion 19.14

We need to initially load the Module and connect to the API Endpoint:

Optionally: Loading the Module (if cloned from Github)

ipmo .\PPDM-pwsh -Force
Connect-PPDMapiEndpoint -PPDM_API_URI https://<your ppdm server> -trustCert

this uses a user password authentication. the token is saved as a Global Variable. You also can use a secure Credentials string to connect. Credentials will be stored in Session ofr easy reconnect

😛 Backups ! 😛

Get configured Protection Policies

 Get-PPDMprotection_policies | ft

image

Start a Protection Policy (ad-Hoc Backup) by an ID

Start-PPDMprotection_policies -PolicyID <ID>

Start Protection Policy based on Pipeline Query

this starts the Policy that matches the name Exchange and is not Self Service

Get-PPDMprotection_policies | where { ($_.name -match "Exchange") -and ($_.passive -eq $False) } | Start-PPDMprotection_policies

⭐ Query the Queued activity

Get-PPDMactivities -days 1 -PredefinedFilter QUEUED

image

⭐ Query Finished Successfull Activities, query for "Manual" in name

Get-PPDMactivities -days 1 -PredefinedFilter PROTECT_OK -query Manual | ft

image

working with assets

getting all assets

Get-PPDMassets | ft

getting specific asset(s)

now we want to see a specific asset

Get-PPDMassets | where name -eq dcnode

And finally view the Storage and Replica Locations .....

Get a map of PPDM Copies per Asset ID

(Get-PPDMassets | where name -eq dcnode | Get-PPDMcopy_map).storagelocations

Some other Commands

Get-PPDMinventory_sources | ft
Get-PPDMprotection_policies | ft
Start-PPDMprotection_policies -PolicyID 4f8ee8f7-68ef-4c09-8789-17301e82be3a
Get-PPDMactivities -Filter RUNNING | ft
Get-PPDMactivities  -query Kubernetes -Filter RUNNING | ft
Get-PPDMprotection_policies | ft
 (Get-PPDMprotection_policies -id 200fb9c7-22a8-406b-b495-b6d6457de034).stages | ft

storage

Get-PPDMstorage_systems
Get-PPDMdatadomain_cloud_units -storageSystemId ed9a3cd6-7e69-4332-a299-aaf258e23328

🆕 ⭐ Protection Policy Creation

Create a Centralized Exchange Backup Policy In order to create a Primary Backup for Exchange, we fisrt need to create a Schdule locally Schedules for Primary Backup set the Time / Window for Synthetic Fulls, and Optionally the Time For FULLS

$schedule=New-PPDMBackupSchedule -hourly_w_full_weekly -CreateCopyIntervalHrs 2 -CreateFull_Every_DayofWeek SUNDAY -RetentionUnit DAY -RetentionInterval 7 

this Translates into a Primary PPDM Backup Schedule as follows:

image

Now we can set the Backup Policy with Above Schedule, and control Exchange Specific Feature

New-PPDMExchangeBackupPolicy -Schedule $sched -StorageSystemID ed9a3cd6-7e69-4332-a299-aaf258e23328 -consistencyCheck LOGS_ONLY -enabled -encrypted -Name CI_EX_CLI_CENTRAL2

⭐ ⭐ ⭐Monitor activities

get activity Metrics

Get-PPDMactivity_metrics

this gets all metrics of the actual day, us -days parameters for extended list

💣 get failed activities

Things can fail, i want to know !

Get-PPDMactivities  -query Kubernetes -days 14 -PredefinedFilter PROTECT_FAILED | Select-Object name, id -ExpandProperty result

Custom Filters

From above, we can see that predefined query filters are used. PowerProtect comes with it´s own query filters, see more from

Get-Help Get-PPDMactivities -Online

You can use your own Filters:

# get a date stamp from -1 week ( Adjust to you duration)
$myDate=(get-date).AddDays(-7)
$usedate=get-date $myDate -Format yyyy-MM-ddThh:mm:ssZ

# all protection Jobs last week
$FILTER='startTime ge "'+$usedate+'" and parentId eq null and classType in ("JOB", "JOB_GROUP") and category in ("CLOUD_TIER","EXPORT_REUSE","PROTECT","REPLICATE","RESTORE","CLOUD_PROTECT")'
Get-PPDMactivities -Filter $FILTER  | Select-Object * -ExpandProperty result | ft 

# all failed last week
$FILTER='startTime ge "'+$usedate+'" and parentId eq null and classType in ("JOB", "JOB_GROUP") and category in ("CLOUD_TIER","EXPORT_REUSE","PROTECT","REPLICATE","RESTORE","CLOUD_PROTECT") and result.status eq "FAILED"'
Get-PPDMactivities -Filter $FILTER  | Select-Object * -ExpandProperty result | ft 

# Protect SUCCEEDED
$FILTER='result.status in  ("OK","OK_WITH_ERRORS") and startTime ge "'+$usedate+'" and parentId eq null and classType in ("JOB", "JOB_GROUP") and category in ("PROTECT")'
Get-PPDMactivities -Filter $FILTER  | Select-Object * -ExpandProperty result | ft 


# filter for failed system jobs
$FILTER='startTime ge "'+$usedate+'" and parentId eq null and classType in ("JOB", "JOB_GROUP") and category in ("CONSOLE","CONFIG","CLOUD_DR","CLOUD_COPY_RECOVER","DELETE","DISASTER_RECOVERY","DISCOVER","MANAGE","NOTIFY","SYSTEM","VALIDATE") and result.status eq "FAILED"'

# filter for Successfull system:
$FILTER='startTime ge "'+$usedate+'" and parentId eq null and classType in ("JOB", "JOB_GROUP") and category in ("CONSOLE","CONFIG","CLOUD_DR","CLOUD_COPY_RECOVER","DELETE","DISASTER_RECOVERY","DISCOVER","MANAGE","NOTIFY","SYSTEM","VALIDATE") and result.status eq "OK"'