Powershell Backup Cmdlets in Hyper-V Server 2008 R2


  • Hi all,

    I hope this is the correct forum for my questition - Hyper-V Server 2008 R2 is more or less a normal Server Core, right?
    So here goes:
    In order to configure and use the Windows server backup on Hyper-V Server 2008 R2 I need a command line interface. Usually powershell cmdlets for server backup may be installed as a feature. But not so on Hyper-V Server 2008 R2.

    Am I missing something?
    Is it possible to somehow add these cmdlets?


    Friday, April 09, 2010 5:48 PM


All replies

  • Hi,


    PowerShell is not installed by default after you installed Hyper-V Server 2008, you need to installed it manually.


    Before you install PowerShell, you should install NetFx2-ServerCore first, because PowerShell runs based on .Netframawork. You can perform the following steps:


    1.    Use the following command to displays a list of features and their status:


    DISM /Online /Get-Features


    2.    Enables the NetFx2-ServerCore feature:


    DISM /Online /Enable-Feature /FeatureName: NetFx2-ServerCore


    3.    Enables the PowerShell feature:


    DISM /Online /Enable-Feature /FeatureName: MicrosoftWindowsPowerShell


    When you finish the above steps, you will be able to find the C:\Windows\system32\WindowsPowerShell folder and launch the shell.


    In addition, you can use the following PowerShell script to backup files.


    Backup Files Using Windows PowerShell



    Best Regards,

    Vincent Hu


    Saturday, April 10, 2010 6:05 AM
  • I enabled the powershell feature and the Windows Server Backup feature but can't find the Windows Server Backup Command-line Tools feature. So the WSB cmdlets cannot be installed the usual way.
    Do I have to install it using some additional package or are the WSB cmdlets not meant to be used on Hyper-V Server 2008 R2?
    If so I would like to understand why.



    Saturday, April 10, 2010 4:41 PM
  • Hi,


    The Command-Line tools for Windows Server Backup is wbadmin. For more information, you can refer to:


    Windows Server Backup Command Reference



    Best Regards,

    Vincent Hu


    Monday, April 12, 2010 8:29 AM
  • Hi,

    wbadmin functionality is reduced on W2k8 R2. The table on technet that you were referencing says "this subcommand applies only to Windows Server 2008." for a lot of subcommands.

    I guess they have been removed from wbadmin because the powershell cmdlets may be used for the respective purposes.
    But if the cmdlets are absent...?


    Monday, April 12, 2010 8:59 AM
  • Hi,


    In Windows Server 2008 R2, you need to install the command-line tools for Windows Serve Backup. When you type “wbadmin /?” you will get the same command as Windows Serve Backup in Windows Server 2008.


    For PowerShell for Windows Server Backup, you can refer to:


    PowerShell for Windows Server Backup!43CFA46A74CF3E96!1006.entry



    Best Regards,

    Vincent Hu


    Wednesday, April 14, 2010 5:39 AM
  • Hi,

    OK, so the technet article seems to be a bit misleading in saying that some subcommands apply only to Windows Server 2008. The full functionality of wbadmin is not only present in W2k8 but also in R2.

    Unfortunately I still don't understand how to use the Windows Backup powershell cmdlets on Hyper-V Server 2008 R2.

    They are not present after adding the backup feature (add-pssnapin Windows.ServerBackup doesn't work) and the WindowsServerBackupCommandlet feature is not availabel for installation.
    So the question is if there is a way to install the backup cmdlets or if they are just not available on Hyper-V Server 2008 R2 (and why).


    Wednesday, April 14, 2010 7:08 AM
  • Hi,


    Base on my research, the Windows.ServerBackup snapin is not available in Hyper-V Server 2008 R2. I will report this to our product team, if there are any news, I will update here.


    By the way, you can report this to Microsoft Connect.




    Best Regards,

    Vincent Hu


    • Marked as answer by Klaus Salger Friday, April 16, 2010 6:52 AM
    Friday, April 16, 2010 6:16 AM
  • Klaus:

    If you are still looking for answers, I was able to get the cmdlets working in server core 2008 R2. after you have installed the backup and backupcommandlet features in order with ocsetup or dism, start powershell and type add-pssnapin windows.serverbackup

    if everything in order, get-command *wb* -commandtype cmdlet will list all the available backup cmdlets.

    good luck,


    Friday, June 04, 2010 8:43 PM
  • Vincent, can you point me to documentation for HyperV Server 2008 R2 that states the snapin is unavailable? that would be good info to have handy. I don't have HV server deployed here to test, but I run hyper-v hosts on server core 2008 R2, and am able to run the backup cmdlets in powershell after running this cmdlet: add-pssnapin windows.serverbackup.


    Friday, June 04, 2010 8:51 PM
  • in server core 2008 R2, these steps are nicely packaged up in sconfig.cmd. select menu item 4 "Configure Remote Management", then select item 2 "Enable Windows PowerShell". I'm interested to know if this is not available in the Hyper-V Server r2 edition.

    several other common server core configuration settings can be managed from this script.


    Friday, June 04, 2010 9:00 PM
  • Hi John,

    thanks for the tip.

    The problem is that while the backup commandlet feature is available on W2k8 R2 Core, it actually is NOT on Hyper-V Server 2008 R2.
    No idea why this feature has been removed from the product.



    Friday, June 04, 2010 10:52 PM