{"id":10979,"date":"2010-11-23T14:51:46","date_gmt":"2010-11-23T14:51:46","guid":{"rendered":"https:\/\/aidanfinn.com\/?p=10979"},"modified":"2010-11-23T14:51:46","modified_gmt":"2010-11-23T14:51:46","slug":"backup-vmm-2008-r2-using-powershell","status":"publish","type":"post","link":"https:\/\/aidanfinn.com\/?p=10979","title":{"rendered":"Backup VMM 2008 R2 Using PowerShell"},"content":{"rendered":"<p>I just found a handy <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dd446635.aspx\" target=\"_blank\">page<\/a> with a Microsoft-written PowerShell script for backing up a System Center Virtual Machine Manager 2008 R2 database.<\/p>\n<p>You start off by writing a script with two lines:<\/p>\n<p><em>$VMMServer = Get-VMMServer -ComputerName &quot;&lt;&lt;insert the FQDN of your VMM server here&gt;&gt;&quot;<\/em><\/p>\n<p><em>Backup-VMMServer \u2013Path &quot;D:VMMBackups&quot; -VMMServer $VMMServer<\/em><\/p>\n<p>In the MS example, you save that as C:MyScriptsBackupVMMDatabase.ps1. I\u2019ve tweaked it so it backs up the database to the D: drive which is probably the library drive and (hopefully) has plenty of free space.<\/p>\n<p>You can create a scheduled task to run the following command (one line) for VMM 2008 R2:<\/p>\n<p><em>PowerShell.exe -PSConsoleFile &quot;C:Program FilesMicrosoft System Center Virtual Machine<\/em><em> Manager 2008 R2bincli.psc1&quot; -Command &quot;.&#8217;C:MyScriptsBackupVMMDatabase.ps1&#8217;&quot;<\/em><\/p>\n<p>Otherwise, you can do this by hand in the Administration view \u2013&gt; General, and clicking the Back Up Virtual Machine Manager task in the Actions pane.&#160; You can also use a traditional SQL backup of the database.&#160; And don\u2019t forget to backup the library file share!<\/p>\n<p>EDIT #1:<\/p>\n<p>You will need to change the <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/ee176961.aspx\" target=\"_blank\">PowerShell script execution policy<\/a>.&#160; You can sign the script and se the policy to AllSigned.&#160; Or you can set it to Unrestricted.<\/p>\n<div style=\"padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px\" id=\"scid:0767317B-992E-4b12-91E0-4F059A8CECA8:85994c37-03bd-4995-adf8-32edd175194b\" class=\"wlWriterEditableSmartContent\">Technorati Tags: <a href=\"http:\/\/technorati.com\/tags\/System+Center\" rel=\"tag\">System Center<\/a>,<a href=\"http:\/\/technorati.com\/tags\/VMM\" rel=\"tag\">VMM<\/a>,<a href=\"http:\/\/technorati.com\/tags\/Hyper-V\" rel=\"tag\">Hyper-V<\/a>,<a href=\"http:\/\/technorati.com\/tags\/Backup\" rel=\"tag\">Backup<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I just found a handy page with a Microsoft-written PowerShell script for backing up a System Center Virtual Machine Manager 2008 R2 database. You start off by writing a script with two lines: $VMMServer = Get-VMMServer -ComputerName &quot;&lt;&lt;insert the FQDN of your VMM server here&gt;&gt;&quot; Backup-VMMServer \u2013Path &quot;D:VMMBackups&quot; -VMMServer $VMMServer In the MS example, you &hellip; <a href=\"https:\/\/aidanfinn.com\/?p=10979\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Backup VMM 2008 R2 Using PowerShell&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[20],"tags":[55,181,193,196],"class_list":["post-10979","post","type-post","status-publish","format-standard","hentry","category-hyper-v","tag-backup","tag-hyper-v","tag-system-center","tag-vmm"],"aioseo_notices":[],"jetpack_featured_media_url":"","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/10979","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10979"}],"version-history":[{"count":0,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/10979\/revisions"}],"wp:attachment":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}