Skip to content

bottkars/PPDM-pwsh

Repository files navigation

PPDM-pwsh

❤️ THE Powershell Modules for Dell PowerProtect DataManager API ❤️

🌅 This is the 19.14 Vesrion 🌅

installing the Module and connecting to PPDM

the module should be installed from PSgallery

Install-Module -Name PPDM-pwsh	-MinimumVersion 19.14.20

connect to the API Endpoint:

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

this will do an interactive password/authentication to retrieve the token. The login can alos be done via a PSCredential object.
The token is saved as a Global Variable.

All functions can use -verbose to show the API Calls amde against the PPDM

Workload Examples

This section gives Some Examples for Workloads. Most of the Examples are also available from the Inline Help, e.g.

get-help New-PPDMProtectionEngineProxy -Examples 

VMware Protection

Example for vMware Based Protections, Policies
VM Restore from CLI
VM Instant Access Restore LINUX VM
Example Script Custom Restore Comments
Example script to exclude Disks from VM Asset Create AppAware MSSQL Protection using Transparent Snapshots

Kubernetes Protection

Examples for Kubernetes Onboarding, Protection and restores
Kubernetes Protection
Example script to exclude PVC with Storage certain Classes

Agent Protection

Examples for Managing Agent Based Protection and Policies
FSAgent Agent
MSSQL Agent
Create Centralized MSSQL Protection Policy
Create Self Service MSSQL Policy Manage Agent Updates

Management Examples

Asset Management

Examples for managing Assets
Asset Management Manage AppHosts Preferred IP/Comms Assignment

Manage Common Settings

There are Common Appliance Settings that can be retreive and modified View and Modify Common Settings

Restore Plans

Example Script getting Assets protected in restore Plan

Inventory Examples

Managing / Adding Protection Storage

Example Script adding a DataDomain
The Storage_Systems API has some festures for Capacity Reports // NFS Shares described here
Examles for Managing Storage and Capacity

Managing vProxies

Add a Kubernetes Proxy
Add a vSphereProxy with NBD

PPDM Deployment

Example Script to wait for Appliance Fresh Install State
Example Script to start PPDM Initial Configuration
Example Script to wait for Appliance Configured

Missing a cmdlet and have an API endpoint? No worries, keep Prototyping

We implemented an Request Wrapper for PPDM API requeststhat utilizes all header ane endpoint variables

NAME
    Invoke-PPDMapirequest

SYNTAX
    Invoke-PPDMapirequest -OutFile <Object> [-uri <Object>] [-Method {Get | Delete | Put | Post | Patch}] [-Query <Object>] [-ContentType <Object>]
    [-ResponseHeadersVariable <Object>] [-apiver <Object>] [-retries <int>] [-timeout <int>] [-apiport <Object>] [-PPDM_API_BaseUri <Object>] [-RequestMethod {Rest | Web}]
    [<CommonParameters>]

    Invoke-PPDMapirequest -uri <Object> -Method {Get | Delete | Put | Post | Patch} -Query <Object> -InFile <Object> [-ContentType <Object>] [-ResponseHeadersVariable
    <Object>] [-apiver <Object>] [-retries <int>] [-timeout <int>] [-apiport <Object>] [-PPDM_API_BaseUri <Object>] [-RequestMethod {Rest | Web}] [<CommonParameters>]

    Invoke-PPDMapirequest -uri <Object> [-Method {Get | Delete | Put | Post | Patch}] [-Query <Object>] [-ContentType <Object>] [-ResponseHeadersVariable <Object>] [-apiver
    <Object>] [-retries <int>] [-timeout <int>] [-apiport <Object>] [-PPDM_API_BaseUri <Object>] [-RequestMethod {Rest | Web}] [-Body <Object>] [-Filter <Object>]
    [<CommonParameters>]

Thus, you only need to specify the relative

Invoke-PPDMapirequest -Method Get -uri /copy-metrics

Note, this will utilize a WebRequest per default and thus return a Json Document, including Response Headers, to be converted

One can utilize the RestMethod via

Invoke-PPDMapirequest -Method Get -RequestMethod Rest -uri /copy-metrics

This will return only content and page as PSobjects, for Headers a Hedervariable must be requested (only need for some POST request )

Currently exported Funtions

Add-PPDMAssetSource
Disable-PPDMProxy
Get-PPDMagents
Get-PPDMAssetSource
Get-PPDMFLRfiles
Get-PPDMk8sclusters
Get-PPDMk8spvcmappings
Get-PPDMProxy
Get-PPDMServiceStatus
Get-PPDMStorageMetrics
Get-PPDMVPE
New-PPDMProxy
Remove-PPDMAssetSource
Remove-PPDMProxy
Request-PPDMJobLog
Restore-PPDMDDB_MSSQL
Restore-PPDMFLR
Restore-PPDMVMAsset
Save-PPDMJobLog
Set-PPDMAsset
Set-PPDMAssetSource
Set-PPDMFLRbrowsescope
Start-PPDMPLC
Start-PPDMPLCStage
Start-PPDMProtectionStage
Unregister-PPDMAssetFromPoliy
Add-PPDMcertificates
Add-PPDMinventory_sources
Add-PPDMProtection_policy_assignment
Approve-PPDMcertificates
Approve-PPDMEula
Connect-PPDMapiEndpoint
Disable-PPDMprotectionEngineProxy
Disconnect-PPDMsession
Get-PPDMactivities
Get-PPDMactivity_metrics
Get-PPDMagents_update_sessions
Get-PPDMagent_registration_status
Get-PPDMalerts
Get-PPDMassetcopies
Get-PPDMassets
Get-PPDMasset_protection_metrics
Get-PPDMaudit_logs
Get-PPDMcertificates
Get-PPDMcloud_dr_accounts
Get-PPDMcloud_dr_data_targets
Get-PPDMcloud_dr_server_configuration
Get-PPDMcloud_dr_server_deployment
Get-PPDMcloud_dr_server_version
Get-PPDMcloud_dr_sessions
Get-PPDMcloud_dr_storage_containers
Get-PPDMcloud_dr_vcenters
Get-PPDMcommon_settings
Get-PPDMcomponents
Get-PPDMconfigstatus
Get-PPDMconfigurations
Get-PPDMcopies
Get-PPDMcopy_map
Get-PPDMcredentials
Get-PPDMdatacomponents
Get-PPDMdatadomain_cloud_units
Get-PPDMdatadomain_ddboost_encryption_settings
Get-PPDMdatadomain_mtrees
Get-PPDMdata_targets
Get-PPDMdiscoveries
Get-PPDMdisks
Get-PPDMflr_filelisting
Get-PPDMflr_sessions
Get-PPDMFSAgentFLRBrowselist
Get-PPDMhosts
Get-PPDMinventory_sources
Get-PPDMkubernetes_clusters
Get-PPDMlatest_copies
Get-PPDMlicenses
Get-PPDMlocations
Get-PPDMnodes
Get-PPDMpasswordpolicies
Get-PPDMprotectionEngineProxies
Get-PPDMprotection_details
Get-PPDMprotection_engines
Get-PPDMprotection_groups
Get-PPDMprotection_policies
Get-PPDMprotection_rules
Get-PPDMprotection_storage_metrics
Get-PPDMpvc_storage_class_mappings
Get-PPDMRestored_copies
Get-PPDMrestore_plans
Get-PPDMroles
Get-PPDMrules
Get-PPDMserver_disaster_recovery_backups
Get-PPDMserver_disaster_recovery_configurations
Get-PPDMserver_disaster_recovery_hosts
Get-PPDMserver_disaster_recovery_status
Get-PPDMsmtp
Get-PPDMstorage_systems
Get-PPDMstorage_system_metrics
Get-PPDMTELEMETRY_SETTING
Get-PPDMTimezones
Get-PPDMupgrade_packages
Get-PPDMusers
Get-PPDMuser_groups
Get-PPDMvcenterDatastores
Get-PPDMWebException
Get-PPDMwhitelist
Invoke-PPDMapirequest
New-PPDMBackupSchedule
New-PPDMcredentials
New-PPDMDatabaseBackupSchedule
New-PPDMExchangeBackupPolicy
New-PPDMFSBackupPolicy
New-PPDMK8SBackupPolicy
New-PPDMlocations
New-PPDMProtectionEngineProxy
New-PPDMRestored_copies
New-PPDMserver_disaster_recovery_backups
New-PPDMsmtp
New-PPDMSQLBackupPolicy
New-PPDMusers
New-PPDMVMBackupPolicy
Remove-PPDMagents_update_sessions
Remove-PPDMcdrs
Remove-PPDMcertificates
Remove-PPDMcomponents
Remove-PPDMcopies
Remove-PPDMcredentials
Remove-PPDMflr_sessions
Remove-PPDMinventory_sources
Remove-PPDMlocations
Remove-PPDMProtectionEngineProxy
Remove-PPDMprotection_policies
Remove-PPDMProtection_policy_assignment
Remove-PPDMprotection_rules
Remove-PPDMserver_disaster_recovery_backups
Remove-PPDMsmtp
Remove-PPDMstorage_systems
Remove-PPDMupgrade
Request-PPDMActivityLog
Restart-PPDMactivities
Restore-PPDMFileFLR_copies
Restore-PPDMflr_sessions
Restore-PPDMK8Scopies
Restore-PPDMMSSQL_copies
Restore-PPDMVMcopies
Save-PPDMActivityLog
Set-PPDMagents_update_sessions
Set-PPDMalerts_acknowledgement
Set-PPDMapp_hosts
Set-PPDMassets
Set-PPDMcertificates
Set-PPDMcloud_dr_accounts
Set-PPDMcommon_settings
Set-PPDMcomponents
Set-PPDMconfigurations
Set-PPDMdiscoveries
Set-PPDMflr_sessions
Set-PPDMinventory_sources
Set-PPDMLicenses
Set-PPDMnodes
Set-PPDMpasswordpolicies
Set-PPDMprotection_rules
Set-PPDMserver_disaster_recovery_configurations
Set-PPDMsmtp
Set-PPDMstorage_systems
Start-PPDMasset_backups
Start-PPDMdiscoveries
Start-PPDMflr_sessions
Start-PPDMprotection
Start-PPDMprotection_policies
Stop-PPDMactivities
Stop-PPDMupgrade
Stop-PPDMupgradePrecheck
Unblock-PPDMSSLCerts
Update-PPDMaudit_logs
Update-PPDMcertificates
Update-PPDMcredentials
Update-PPDMserver_disaster_recovery_backups
Update-PPDMToken
Wait-PPDMApplianceFresh