msgbartop
Everybody get your shell on!
msgbarbottom

Scripting de-provisioning of a client in DPM

If you are trying to automate your DPM environment, part of the process is de-provisioning protection groups when a server no longer needs to be backed up. This code snippet will take a clientname input and dpmserver input parameter and remove all data sources (which will effectively remove the protection group) for that client. This assumes that the protection group name is the same as the client name (in our environment we run a single protection group for each client that is the same name as the client to increase flexibility). If you are running multiple clients under a single protection group, keep in mind that this will remove ALL data sources under the defined protection group.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
param($clientname,$dpmserver)
 
connect-dpmserver -dpmservername $dpmserver
$pgname = Get-ProtectionGroup $dpmserver | where {$_.friendlyname -eq $clientname}
$mpg = get-modifiableprotectiongroup $pgname
$ds = Get-Datasource -ProtectionGroup $mpg
 
foreach ($volume in $ds)
{
remove-childdatasource -ProtectionGroup $pgname -childDatasource $volume
}
 
set-protectiongroup $pgname
Disconnect-DPMServer $dpmserver
  • Twitter
  • Facebook
  • LinkedIn
  • Digg
  • Google Bookmarks
  • Slashdot
  • StumbleUpon
  • Live
  • FriendFeed
  • Ping.fm
  • Print
  • email
  • PDF
  • RSS

Tags: ,

Leave a Comment