Powershell commands for VM backups in 2012 vs 2008

I have a powershell routine that is used by task scheduler that will shut down one or more Hyper-v VMs from a list, create a backup of the VHD file(s) then restart the VM(s).  It works great in 2008 but when I copied it over to a 2012 host, it
didn't do anything.  I was wondering if powershell commands from 2008 still work in 2012 or if they've been completely rewritten.  If they are the same, then I'll assume "operator error" and keep trying.  If they have changed, then
I know that I'll be spending my week googling around for how to use the new commands.  Thanks.

Hello
You can use below powershell comand for Server 2012 host.
$backuppolicy = New-WBPolicy
Get-WBVirtualMachine | Add-WBVirtualMachine -Policy $backuppolicy
$targetfolder = New-WBBackupTarget -NetworkPath
\\FileServerName\e$\BackupFolder -Credential (Get-Credential)
Add-WBBackupTarget -Policy $backuppolicy -Target $targetfolder
Set-WBSchedule -Policy $backuppolicy -Schedule 12:00,09:00
$backuppolicy
Set-WBPolicy $backkuppolicy
Start-WBBackup -Policy $backuppolicy
http://get-itlabs.com/ucretsiz-windows-hyper-v-server-2012-r2-backup/
Ersin CAN - TAT MCSE - Private Cloud. www.get-itlabs.com

Similar Messages

  • Best command for script backup?

    hello,
    i always use robocopy for file backup , but with powershell and the new technologies is still the easiest and best choice?

    Your initial question was "Best command for script backup?". For this you received an answer. If you now need support on the subject of your script then you should start a new thread. Note also that you must test your robocopy command from a
    command line before trying to embed it in a PowerShell script.

  • Powershell Command for global package update?

    Dear Community,
    at the moment I'm testing some packages on my development system without any App-V infrastructure in use.
    So I create my package on the sequencer and use this powershell command to publish the package:
    Add-AppvClientPackage -Path <Path to App-V Share> | Mount-AppVClientPackage | Publish-AppvClientPackage -Global
    This works fine and I'm able to test my application. But I don't know the PowerShell command to update an existing package on my system.
    Any help appreciated!
    Thanks,
    Hoba

    We are talking different things.
    Providing a new version for an already existing package does not remove the previous from disk (for instance people might be using version 1 while other people use version 2 on the same machine).
    If you want to fully remove version 1 then yes, do the command RalJans said.  It is my understanding that the App-V client is smart enough to stream only the 'new' bits from version 2, so even though they both remain on disk you aren't necessarily eating
    up 2x the diskspace.  I'm sure you could override that by mounting, etc.
    As for your question about unpublishing, I've always had it recommended to perform an unpublish and remove because remove only will leave behind certain things, so unpublishing is cleaner.  And yes be careful, the -all refers to all packages on the
    machine, it is not part of the package name.
    I don't know what you mean by refresh options.  The way upgrading works is by 2 packages containing the same package GUID but a different package GUID that both get added|published to the same machine.  You don't have to (you also don't get to)
    choose which package is a new version.  For example, you may consider it a new version, but if you had to go back to the sequencer and start over from scratch, the App-V Client will not allow you to treat them as the same package.

  • Powershell command for adding permissions in the "winrm configsddl wmi" menu

    Hello,
    I was wondering if there was any powershell command that would be the equivalent of adding a user in the menu brought up by typing
    winrm configsddl wmi
    I want to be able to add Read permission for users.
    Thanks,
    Brian

    Hi Brian,
    You can try to create and add the user to the local group which has been set as the read permission of the "http://schemas.microsoft.com/wbem/wsman/1/wmi".
    To add local users to local group in powershell, please refer to this thread:
    Adding local user accounts to Local administrator group:
    http://powershell.com/cs/forums/t/6369.aspx
    I hope this helps.

  • Powershell command for adding the package

    Dear All, 
    Am using SCCM 2007 and Powershell v1.0. First thing I would like to ask is does the version of powershell and sccm are interdependent? Why beacuse, am searching for the cmdlet to add the package to the distribution point. Still I didn't get the command to
    add. All the commands that I got are used in sccm2012 and powershell v3.0. When I use any of the commands, am getting "System.String() does not contain this method" as the error. I searched in Powershell prompt to get the list of cmdlets used. I
    did not find any relative command to add the package to the dp. 
    Please help. 
    Parameswaran.

    make use of the powershell script avilable here on http://eskonr.com/2014/02/configmgr-2012powershell-script-add-packages-applicationsdrivers-to-distribution-point-2/
    Eswar Koneti | Configmgr blog:
    www.eskonr.com | Linkedin: Eswar Koneti
    | Twitter: Eskonr

  • The underlying connection was closed: An unexpected error occurred on a receive..Exception.Message - while executing powershell command for sharepoint online site

    " +The underlying connection was closed: An unexpected error occurred on a receive..Exception.Message " OR sometimes
    "The remote server returned an error: (503) Server Unavailable..Exception.Message"
    Getting exception above when performing various operation (site coll creating, group creation, adding users to group) for sharepoint online (Office 365) site using powershell script.
    I want to create 3500 site collections using PS script. In-between getting above exception so it will skip one site collection creating and working again. for eg. after creating 11 site coll, script will through above exception and so 12th site coll will
    not be create but working fine from 13 and so on...

    Remote server seems working to me...any additional check?
    if problem with remote server then may be loop to create site provisioning should not start again..Right?
    any idea?

  • Combining 2 PowerShell Commands for One Output

    Folks, novice here and I am trying to combine the following commands into one output (if possible)...any guidance? Thanks!
    Get-ADUser -Filter 'teletexterminalidentifier -like "*"'|Select-Object name,teletexterminalidentifier|Export-Csv c:\profile_set1.csv
    Get-ADUser | select SamAccountName,Enabled | Out-File C:\AcctStatus.csv
    In other words, is there a way to pipe these into one command and one set of results (one file)?
    Thanks!

    Get-ADUser -LDAPFilter '(teletexterminalidentifier=*)'|
    Select-Object Name,SamAccountName,TeletexTerminalIdentifier,Enabled |
    Export-Csv c:\profile_set1.csv
    The LDAPFilter is concise and will be a much faster.
    ¯\_(ツ)_/¯

  • PowerShell command To configure Access Service 2010 in sharepoint 2013 server

    HI ,
    can any body give reference for Powershell command for
    Access Service 2010
    I am currently able to run powershell command for
    Access Service .
    But in sharepoint 2013,Access Service 2010 is a new service, but i am not able to see any refernce blog for command.

    Hi,
    According to your description, you want to configure Access Service 2010 in SharePoint 2013 server by using a Windows PowerShell.
    Take a look at an articles about configuring services and service applications in SharePoint 2013:
    http://technet.microsoft.com/en-us/library/ee794878(v=office.15).aspx
    Updates on how to do a lot of these (include
    configure Access Service 2010 ) with PowerShell haven't really been released yet. 
    Here is an article about configuring a service application by using a Windows PowerShell script (SharePoint Server 2010), you can use as a reference:
    http://technet.microsoft.com/en-us/library/gg983005(v=office.14).aspx
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Lisa Chen
    TechNet Community Support

  • Using Echo Command in PowerShell Script for Configuration Item

    Hello All,
    Before you tell me to post my PowerShell question to the PowerShell Forum, please know that the PowerShell portion of my task works just fine. It is the SCCM portion of my task that keeps failing, so that is why I am here. To give some background...
    There are two servers in our SCCM test environment. Both the SCCM server and SQL DB server are 2012, patched and updated.
    Test servers in my Device Collection being used for running Baselines and Reports against are 2008R2 and 2012, patched and updated.
    I have created a Configuration Item that checks to see if the FTP Server Role Feature has been installed on a 2008 or 2012 server. To do the check, I am using the following PowerShell script:
    (get-windowsfeature -Name Web-Ftp-Server).Installed
    When I log into my 2008R2 and 2012 test servers, and run this command directly on the server, it will return a "True" if the FTP Server Role Feature is installed on either server, and a "False" if it is not installed. Basically,
    it works as advertised.
    When I setup my Configuration Item and then deploy my Baseline, or run a report against my device collection of test servers, SCCM will return a correct response (True or False) for the 2012 test server, but throws the following error for the 2008R2
    server:
    0x87df00329 application requirement evaluation or detection failed
    Google searches for this have not been very helpful.
    Now, when I created the Configuration Item and referenced PowerShell, the configuration screen has the following note:
    "Specify the script to find and return the value to be assessed for compliance on client devices. Use the echo command to return the script value to Configuration Manager."
    Since I did not include an echo command in my PowerShell script above, I figured that was my problem, so I did the following:
    Logging onto both of my test servers (2008R2 & 2012) I was able to successfully run the following PowerShell commands and get the expected responses of True or False:
    (get-windowsfeature -Name Web-Ftp-Server).Installed | echo
    (get-windowsfeature -Name Web-Ftp-Server).Installed | write-output (http://technet.microsoft.com/en-us/library/hh849921.aspx)
    (get-windowsfeature -Name Web-Ftp-Server).Installed | write-host (http://technet.microsoft.com/en-us/library/ee177031.aspx)
    However, when I use any of these PowerShell commands in my Configuration Item, NEITHER of my test servers returns a response to the SCCM server.
    When I check the report, both servers show as "Unknown" and when I click on the number 2 (as in 2 servers unknown), the following report page (List of unknown assets for a configuration baseline) has absolutely no data/information at all.
    So...I am at a loss.
    SCCM tells me to use an echo command to return a script value to Configuration Manager. The PowerShell scripts above, with the various echo related commands, work just fine on the servers themselves, but they return no information when run via SCCM.
    What am I missing?
    Any help will be appreciated.
    Thanks in advance for your time.

    Sorry for my ignorance, but I don't understand. (I forgot to mention that I am new at both PowerShell and SCCM.)
    After I change the PowerShell script to add the echo/write-output/write-host cmdlet, I open the ConFig Item and "Clear" the PowerShell script and then re-add it. When I do that, it correctly shows the change in the ConFig Item.
    Next I open the Baseline, then open the ConFig Item within the Baseline to make sure the change is reflected there as well, which it is.
    I then deploy the Baseline to my Device Collection. After that, I run a report against the Baseline and Device Collection and it returns the "Unknown" result.
    If I open the PowerShell script and remove the echo/write-output/write-host cmdlet, then go through the rest of the process of updating and reporting, the result it returns changes, showing one server in compliance and the other server out of compliance,
    which leads me to think that all changes have taken correctly.
    Does that sound right? If I manually deploy the Baseline, is that the same as the client retrieving policies from the management point?
    Sorry to be so thick but I'm learning as I go.
    Thanks again for your help.

  • How to get Systemstate Backup size using PowerShell command in Windows 2008 R2

    Hi,
    We using WBSummary command to get completed backup status.
    I need to find how much data is backed up  using powerShell command .
    Is there any way to get the details , i can see the GUI but no in command.
    Please advise
    Regards Gopi K

    Hi,
    You mentioned that you can see the system state backup size in the GUI. Does the backup size mean the amount of date transferred?
    It seems that there is no such a PowerShell to get Systemstate Backup size. You may need to you need a PowerShell scripts to do this work.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=ITCG
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • TotalVHDCapacity attribute is returning zero in "Get-SCVMTemplate | select Name, TotalVhdCapacity" powershell command though the Vhd capacity is 20 gb in size, vmm 2012 r2

    Hi All,
    TotalVHDCapacity attribute is returning zero in "Get-SCVMTemplate | select Name, TotalVhdCapacity" powershell command though the template has Vhd capacity is 20 gb in size, vmm 2012 r2. I can create VM using this template too.
    For other templates it is returning correct value though.
    Can anyone help us understanding the root cause and the solution too.
    Thanks in advance.
    Debabrata

    I booted this drive from another computer (Asrock M3A770DE mobo) and works fine, speed with dd was ~100MB/s
    I also update bios on my first computer with Intel D945GSEJT (there is selected AHCI mode) still the same transfers with dd (~10Mb/s)
    I have no idea what to do with it now
    EDIT:
    More tests with other hdd (Samsung HD502IJ), dd on mounted NTFS partition:
    Intel D945GSEJT booted from Archlinux iso:
    hdparm: ~75 MB/s
    dd: ~10 MB/s
    Intel D945GSEJT booted from Archlinux iso, HDD connected to PCI SATA controller (Promise 378):
    hdparm: ~60 MB/s
    dd: ~10 MB/s
    Asrock M3A770DE booted from Archlinux iso:
    hdparm: ~87 MB/s
    dd: ~76 MB/s
    Asrock M3A770DE booted from Archlinux iso, HDD connected to PCI SATA controller (Promise 378):
    hdparm: ~81MB/s
    dd: ~76 MB/s
    What is broken on D945GSEJT?
    Last edited by miskoala (2012-03-30 13:47:23)

  • What commands used for taking backup of oracle database using BR*Tools

    Can somebody please help me urgently to know what are the commands used for taking backup of oracle database using BR TOOLS.Also specifythe commands in detail which can be used for taking backups of oracle database ,Online Redo log files in databse using BRBACK tool,Archiving of offline, redo log files using BRARCHIVE, and Restoring a Database using BRRESTORE tool Commands(Plese specify the commands with their Syntax used).Also specify the commands with their Syntax which are used for taking backup of oracle database(online,Offline redo log files) into Tapedrives using BRTOOLS commands.
    Thanking You for helping (in advance).

    Dear Ashish,
    BRBACKUP / BRARCHIVE calls the operating system command to copy the files.
    Simple approach to get the commands is as follows.
    1. Set the BR_TRACE (as given in the SAP note 29321) and run the command for which you need to know the OS / SQL commands.
    2. This will generate the log file with the trace information. This trace has the information of the commands used by the job you have run.
    Hope this helps.
    Regards,
    Madhukar

  • Code for retrieving powershell command output

    Is there any scripting in java to get the output of powershell command.

    hello 
    please help me out
    I want to retrieve security eventlog with powershell command.but when ever run the powershell code I recieve the following error:
    Requested registry access is not allowed
    so that,I have searched  on the internet Days and nights .which I got from the Internet was change the Event log reader Group and change the
    followinfg registry key  and add read permission:
    KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Security
    Right click and Add Read permissions for Event Log Readers.
    in spite of the above task,i can not do that.
    any help would be appreciated

  • SQL or Powershell query to get the SCOM management group id for SCOM 2007 R2 & 2012 / 2012 R2

    Hi All,
    Can any one provide me the SQL or Powershell query to get the SCOM management group id for SCOM 2007 R2 & 2012 / 2012 R2
    I had a SQL query which will query the data from data warehouse and give the management group id but i have lost it for all 3 above.
    Gautam.75801

    Hi Gautam,
    Hope it helps:
    http://blog.tyang.org/2013/03/13/data-aggregation-field-became-empty-in-opsmgr-2007-linked-performance-report/
    http://blog.tyang.org/2012/09/05/mp-authoring-targeting-rms-or-ms/
    Natalya
    ### If my post helped you, please take a moment to Vote as Helpful and\or Mark as an Answer

  • Looking for MS SQL Server(2012 or older versions) all commands

    HI,
    Looking for MS SQL Server(2012 or older versions) all commands, i.e., all available sql server commands.
    Is there any reference manual or MS KL to get all commands in SQL Server ?
    Thanks in advance

    Thanks for link
    Sean Gallardy and Jingyang Li.
    This is is not usefull for my requirement.
    What i am looking is..SQL Server commands  like examples... DDL/DML comands...create/alter
    Examples: Insert/update/delete,truncate.......etc
    Create database,create procedure.......etc
    Alter database,shutdown,drop,create....etc
    Looking for list of all commands in one place/doc in SQL Server.
    Thanks

Maybe you are looking for

  • How to copy referenced photos from dodgy external drive to new drive when whole file will not copy due to error 36.

    My external WD portable passport drive must be dodgy because I can't back it up or clone it or copy 3 of my 22 photo files to a new portable drive. I get error 36 as I attempt all 3 processes. I have copied my iPhoto library, iMovie events and most o

  • AppleTV2 - home sharing issues - (solution that worked for me)

    I have been unable to connect to home sharing for a few weeks. I was speaking to a customer today that just so happened to be an Apple employee (wearing her badge). I told her about my problem, she told me to reset my router. So, I came home an took

  • 3510 printer dropping wireless connection

    I recently installed a 3510 printer using the wireless method and it will work for awhile then a message appears that my scan to computer is off. After this message appears i cannot print by wireless. I have reset things using the usb cord and it tel

  • Lightroom 3.2 - Using subst to a local drive fails

    I recently installed Windows 7 64bit on a spare drive and started playing around with LR to see if there were any changes in performance between Win7 and XP. My current configuration on XP x64 uses subst to map a directory on my "D" drive to the "P"

  • 2004s Workbook Sheet Protection

    I have been attempting to protect the results area of a sheet in a workbook. I have set the properties of the analysis grid to "Enable Cell Protection" I have made the following excel settings. The relevant results area cells have been set to locked.