Creat and backup files / data centers at VIServer

Hello

I want to save my files and my old VIServer datacenter.

I found a script very useful for this but it dosent show me data centers:

filter Get-FolderPath {}

$_ | Get-View | % {

$row = "" | Select the path

$current = get-view $_. Parent

$path = $_. Name

{}

$parent = $current

if($parent.) Name - only "vm") {$path = $parent. {Name + "\" + $path}

$current is get-view $current. Parent

} While ($current. Parent - no $null)

$row. Path = $path

$row

}

}

$report = get - VM | Get-Folderpath

$report | Export-Csv "c:\VM-with-FolderPath.csv" - NoTypeInformation

Is it possible to also write data centers in this spreadsheet to csv?

My other problem is that I want to creat new files and also files and data centers to the terms of this in my new VIServer.

There was also a useful script I found: http://communities.vmware.com/message/1334740#1334740

But in this script 'just' move it already createt VMS in createt records.

And I have no idea how I can modify this script to create folders and datacenters for me.

It would be great if there is a solution for my problem.

You can try the following scripts.

First the script that writes the pathnames to a CSV file

$global:report = @()

function get-children($entity,$path){
     if(!("Datacenters","vm" -contains $entity.Name)){
          $path += ("\" + $entity.Name)
     }
     $children = $entity.ChildEntity
     if($entity.ChildEntity -eq $null){
          $children = $entity.VmFolder
     }
     foreach($child in $children){
          $childfld = Get-View -Id $child
          switch($childfld.gettype().name){
               "Folder" {
                    if($childfld.Name -ne "vm"){
                         $row = "" | select Path, Type
                         $row.Path = ($path + "\" + $childfld.Name)
                         $row.Type = "Folder"
                         $global:report += $row
                    }
                    get-children $childfld $path
               }
               "VirtualMachine"{
               }
               "Datacenter"{
                    $row = "" | select Path, Type
                    $row.Path = ($path + "\" + $childfld.Name)
                    $row.Type = "Datacenter"
                    $global:report += $row
                    get-children $childfld $path
               }
          }
     }
}

Get-Folder -NoRecursion | Get-View | % {
     get-children $_ ""
}
$global:report | Export-Csv "C:\Folder-Export.csv" -NoTypeInformation

This script creates the entries in the data center and the record of the CSV file.

function Get-ViLocation{
     param($path)

     $loc = Get-Folder -NoRecursion
     $qualifiers = $path.Split("\")

     if($qualifiers.Count -gt 2){
          for($i = 1; $i -lt ($qualifiers.Count - 1); $i++){
               $loc = Get-Inventory -Name $qualifiers[$i] -Location $loc
          }
     }
     $loc
}

$list = Import-Csv "C:\Folder-Export.csv" | Sort-Object -Property Path
foreach($entry in $list){
     $operation = "New-" + $entry.Type
     $name = $entry.Path.Split("\")[-1]
     $loc = Get-ViLocation $entry.Path
     $dummy = & $operation -Name $name -Location $loc -WhatIf
}

____________

Blog: LucD notes

Twitter: lucd22

Tags: VMware

Similar Questions

  • I'm changing from PC to Mac.  What should I do to re - install Lightoom? software and backup files

    What should I do to re - install Lightoom? software and backup files.  Do I need anything be it Adobe confirming the prior purchase?

    G

    Thank you Jihn,

    Johanne I checked my order, I realized it was a Mac/Win license so I managed to download the software.  I'll check the forum Lightroom files. Thanks for the suggestion.

    G

  • import of backup files .dat in 6.2.2 point Office Windows 8.1

    I just upgraded my PC Windows 8 (BIG mistake) and he decided to delete all my PALM data files.  I thought THAT I had everything backed up, but the only files I backed up was called a "address.dat" and the new Palm (6.2.2) software is not allowing me to import that.   The 'aba' only backup file I have is from 2005 and that won't do me any good.

    Anyone know how I can import the .dat file in my address book?

    Thank you!

    Mark

    Hello and welcome to the HP support community!

    Only way I know to import data is to install Palm Desktop 4.x on the computer you have now (delete 6.2.2 first - you can't have both installed at the same time!), to create the same account of HotSync name as before and then replace the file address.dat for Palm Desktop user with your saved version.

    See if the data returns.  If so, you can export correctly in order to have an update of the aba file version.

    NOTE: Palm Desktop 4.x will work on Win8 with the Aceeca drivers installed.  Quick installation is not working properly.  Version 6.2.2 adds "install the tool" which works similar to quick setup, but works fine on 64 bit systems.

    WyreNut

  • Question: Table of staging to create and manipulate files, and then save it in the table

    Hello

    I wanted to create an intermediate table to import the files so that later I can manipulate records and finally to save the database.

    I had used the space reserved for this purpose, but I can't create/insert lines in there. Since it is not through an entity object.

    Anyone has an idea about this?

    You use a vo with all transition attributes and insert the data into this before saving the data to the work table.

    Timo

  • Create the flat file data from the oracle table

    d_adp_num char (10)
    d_schd_date tank (8)
    d_sched_code tank (25)
    d_pay_code char (50)
    d_mil_start char (4)
    d_mil_end char (4)
    d_duration char (5)
    d_site_code char (4)
    d_dept_id tank (6)

    Select payroll_id,
    schedule_date,
    reason_code, (sched_code)
    reason_code, (pay_code)
    start_time,
    end_time,
    total_hours,
    site_code,
    department_id
    of dept_staff
    where schedule_date between (sysdate + 1) and (sysdate + 90)


    loading data for the date range instead.
    sched_code - if 'Unavailable' reason_code = 'OD' and 'THE '.

    pay_code - "Berevevement BD" If reason_code = "BD".
    "UP PTO without reasonable excuse" If reason_code = 'UP '.
    "RG" If reason_code = "SH".
    "PTO" If reason_code = "GO".
    Here are some...

    start_time and end_time - convert military time
    based on start_ampm and end_ampm

    On this basis, I need help to create a flat file. Sewing of the flat and data file in dept_staff sample

    If site_code is there so no need to get department_id (see the sample flat file)
    ------------------------------------

    examples of data to flat file

    ZZW002324006072012 PTO
    0800160008.00
    ZZW002428106072012 RG
    1015174507.50HM34
    ZZW002391606072012 RG
    1100193008.50
    ZZW002430406072012 RG
    1100193008.50 130000
    ----------------------------

    dept_staff table data

    REASON_CODE_1 PAYROLL_ID SCHEDULE_DATE REASON_CODE START_TIME, END_TIME START_AMPM END_AMPM TOTAL_HOURS SITE_CODE DEPARTMENT_ID
    ZZW0024468 08/06/2012 HS HS 730 HAS 400 850 12 P
    ZZW0000199 08/06/2012 HS HS 730 HAS 400 850 14 P
    ZZW0023551 08/06/2012 SH SH 1145 A 930 975 GH08 95 P
    ZZW0024460 08/06/2012 SH SH 515 HAS 330 P 1025 GH08 95
    ZZW0023787 08/06/2012 SH SH 630 HAS 300 850 24 P
    ZZW0024595 08/06/2012 TR TR 730 HAS 400 850 90 P
    ZZW0023516 08/06/2012 OD OD 800 HAS 400 800 95 P
    ZZW0023784 08/06/2012 OD OD 800 HAS 400 800 5 P
    ZZW0024445 08/06/2012 SH SH 1145 A GH08 930 975 5 P
    ZZW0024525 08/06/2012 OD OD 800 HAS 400 800 23 P
    ZZW0024592 08/06/2012 TR TR 730 HAS 400 850 5 P
    ZZW0024509 08/06/2012 SH SH 95 MK21 830 HAS 330 P 700

    ZZW0023916 06/14/2012 SH SH 1100 A 850 27 730 P

    How to ask questions
    SQL and PL/SQL FAQ

    UTL_FILE allows to write the OS file

  • Creating and linking to data in a dynamic way

    Hello world

    I have created a form that is available in different languages. That's why I created a radiobutton by language and when you click on one of these buttons, I have dynamiccally bind the XML fragment with a knot existing (javascript code):

    xfa.data.node.loadXML (xml, true, true)

    It works, because I view the XML code in a separate text field to check.

    Later, I want to dynamically bind the elements of my text to the data. Therefore, I have already created links to the XML nodes to be generated later (such as xfa.data.node.tag1.tag2).

    However, I never see the content of the nodes, not even if I create and link the XML file on the initialization of the root element event (so without choosing a language, but certainly before the limit elements are loaded).

    I can see the text when I change a text field calculate event as follows.

    XFA. Data.Node.tag1.tag2.Value

    I am able to access the XML nodes, but for one reason or the other link does not work.

    Someone knows how to fix this? Any help would be greatly appreciated!

    Kind regards

    Tim

    Unfortunately dyna, TR ic data binding not supported in the current version. That is to say that once the form is rendered set binding is not editable. You can read the property, but you cannot change it.

    Paul

  • Windows Server backup - Reporting failure, but creates a backup file

    Currently have a Server 2008 R2 running. Also runs Hyper-V with 3 than VMS. VM can be found on the D drive, so I have given up trying to save with C, since it was time.

    I don't have a setup of daily - just VSS full backup disk Local (c), no bare metal recovery or backup the system state. It's backup on a network drive shared on a different server.

    Daily backup status comes back as having failed. However when I go to the destination that the backup must be going, I see a 280 GB VHD file, which is the size expected to see.

    The error reported in the Windows Server backup is "one of the backup files could not be created. "Error: the parameter is incorrect".

    WSB is horrible to provide crash reports useful on what is the real problem.

    Anyone have any idea why it's create a large file of backup, but reported as having failed with this error?

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • Using USMT to save manually to USBHD and maintaining file Dates

    I am currently using USMT as method of backup of the user data in an enterprise environment prior to migration to windows 7.  in process comes with the tool to perform the backup part and calling USMT from a batch file manually.  We do not use the loadstate function as we keep new own user profiles and avoid loading the parameter that are not needed, and in our batch file, I put the "/ nocompress" option for scanstate.exe creates a folder structure in the backing store file that is created on one of our external usbhd.  This process works well for us that we can quickly see what data has been backed up and only copy of backup data.  The only problem is that the dates of files on all data is adjusted to the time and date that scanstate.exe is run and we would like to have the dates saved with the files to use requested it. (even a manual copy and paste will keep the date).  I looked in the 'includeAttributes' function, but when I try to use this any data that would have been saved until this change is now ignored completely.  The documentation on the use of this feature I find a minimum and I also found not much research to help message boards.  I use MigDocs.xml, MigApp.xml, and a custom.xml who has a certain custom includes and excludes.  If someone can give me some help or direct me to a place I can get info better with the recording of the dates of the files using USMT, that would be appreciated.

    Thank you.

    Hello Richard,.

    Thanks for posting your question on the Microsoft community.

    The question will be better suited to the audience of professionals on the TechNet forums.

    I would recommend posting your query in the TechNet forums.

    TechNet Forum
    https://social.technet.Microsoft.com/forums/Windows/en-us/home?Forum=w7itproperf%2Cw7itprosecurity%2Cw7itprohardware&filter=AllTypes&sort=lastpostdesc

    Thank you

  • How to give permission to my host that they cannot delete files but can create and modify files?

    assuming that I have 5 pc as my host, I want that they cannot delete all files, but can create a file or a folder and can change?

    because

    I want that all transactions are recorded

    Any version of Windows supports this type of file access and logging.  You may be able to find a third-party program that can but I highly doubt it.

  • [ADF, JDev12.1.3] Which is the right place (for example, bean or AM) to create and store secret data that the user is unable to intercept?

    Hallo,

    in my page, when the user clicks on a button, I'have run an operation and in particular generate a code PIN and password that the user must not not know/interception.

    The STEM must be kept "secretly" in the comic book.

    I created a function to generate the PIN code in the 'Utils' to the ViewController project class.

    In the managed bean associated page I would deal with the click of the button through its ActionListener function.

    In this function I would also generate PIN call the "generatePIN" works and finally store the PIN in the comic book.

    Is the bean, the right to 'place' where build and store the PIN in the database?

    Maybe I'd better to generate the PIN and then store it throug a function of the module of the Application?

    Thank you

    Federico

    Well, he should go to the model because it is part of business process and is not part of the presentation of data.

    (AMImpl, VOImpl, or same ViewRowImpl are good places to write such code)

    The STEM must be kept "secretly" in the comic book.

    I don't know what that means exactly.

    Aspect of security, no matter where you place code (in the model or ViewController) because both are executed inside the Java virtual machine server-side.

    If you need to secure communications between WLS and DB, then open the database by using the SSL protocol connection (or create the stored procedure and generate PIN directly in db)...

    Dario

  • When you try to import of IE and click on "Import and backup", "Import data from another browser" is very slightly dark print instead of print and I can't select it. Any suggestiond?

    I followed the instructions to import from another browser, but when I get to the point that should allow me to import IE Favorites, Foxfire displays the feature, but it is in the light print and I cannot select this feature. I'm not interested in returning all sites in bookmarks of Foxfire.

    Make sure that you are not Firefox running in permanent private browsing mode.

    To view the history settings and cookies, choose:

    • Tools > Options > privacy, choose the setting Firefox will: use the custom settings for the story of
    • Uncheck the box: [] "always use the navigation mode private.
  • option "organize bookmarks" not available to backup favorites. So how to create a backup file?

    I'm trying to save my favorites Firefox 4.01. Your help web site says to go to the "brand-pages/organise bookmarks...".

    The problem is that the option is not available in the bookmarks dropdown. So, how can I save my favorites?

    I use a desktop with win7 64 system.

    There seems to be two styles for menus of the show all bookmarks dialog box. Mine not the text, but some people apparently have only icons. In any case, it is the third (see attached image).

  • Data Modeler: how to create and use the collection type

    Hello
    essentially of departure I don't understand how (for example) create and use the data based on the type of data varray type.

    Please notify.
    Thank you
    Andrew

    Hi André,.

    You can create new types of collection (varray/table) in two ways:
    (1) in the browser - find 'Types of data' > 'Types of Collection' node menu dropdown - there just 'create new collection type' it
    (2) in the types of data model diagram - you can create collection "some type structured" or collection of references to the it - use 'new Collection... '. "tool and click first on sight structured type and after the structured type that will contain the collection - new attribute is added to the latter and if there is none this type of collection already didn't set the new collection type are created and you can change it later.

    Philippe

  • If someone created a "save file" for Firefox, would cause problems?

    I had various problems (first to lose some of my FF icons, for example jpeg), now I have problems with
    my e-mail because the 'precarious' icons are appearing on most of the emails that have images. I've reached the point where I
    feel that I can't send these emails, etc..

    Noticed on the information menu "Refresh" here that if a 'refresh' is the fact that 'old data Firefox' on the desktop should be
    deleted. I DID NOT a DISCOUNT, HOWEVER THERE EXISTS a FILE ON THE DESKTOP "old Firefox data NAMED" inside and out
    There is a file named "." lxrajum2.default ".

    This package contains about 32 MB of information FF. I suspect that a computer scientist could possibly create a "backup file."
    I tried to do a 'print screen', failed however

    I HOPE THAT THE REMOVAL OF THIS FILE, OR UNINSTALL FIREEFOX AND RELOCATION WILL SOLVE MY CURRENT DILEMMA. I DON'T WANT TO LOSE FIREFOX.

    Hi Boudica
    I wrote in one of my replies above: uninstall and reinstall of Firefox or by creating a new profile will not help.

    I did not explicitly mention a reset/refresh, but a discount creates a new profile and attempting to transfer data to the new profile.

    It's really a problem of Yahoo and you could only solve this problem by blocking the content involved a content by blocking the extension Adblock Plus to uBlock for example.
    But I don't know what content they are everything and I do not use an extension of myself.

  • PC Crash Recovery - tag, category, and other files

    I had to rebuild my PC due to viruses and other issues to get rid of the virus.

    I did much of the backup computer and hope that I have included some of the files Photoshop Elements 9 I need.

    Can anyone help me with information on where to find files that contain tags, categories, albums and other items that I created in the Organizer to help manage my photos?

    I want to make sure that these files are backed up regularly.

    Also if you know how to install these files after you reinstall PSE it would be useful also.

    Kind regards

    Amby N

    Find your backup for

    *.pse9db

    and restore all of the folder that contains this file (including subdirectories).

    You can restore this directory on any place, and in the Organizer, use the file... Catalogue... Custom location to navigate to the location of this directory to use its catalog.

    This is the system that I use for my data files: since I have several programs that use their own databases, I have created the following directory

    C:\Data

    and subdirectories under it for each program.  For example, I have a

    C:\Data\PSE Organizer\Catalogs\Test01

    Directory for my catalogue "Test01" and so on.  It is so easy to use WinZip to compress just to the top of all the C:\Data directory to create a backup file of all the data for all my programs.

    Ken

Maybe you are looking for

  • Can't access websites from symantec

    I use 19.0a2 Aurora (2012-12-21). I can't use liveupdate to update my Symantec antivirus.I can connect to symantec.com but not LiveUpdate.symantecliveupdate.com LiveUpdate.Symantec.com Akamai.NETI'll be back what about error message cannot find the i

  • XP installation on HDD plus

    Dell 8250 had a 80 GB hd.  Hard drive crashed couldn't find that 80 GB installed 320.  Windows xp will not be installed. BIOS indicates a correct size, score watch shows the correct size. Get this file not copied. This happens on most of the files. C

  • Two error messages when you start the computer.

    First one: dll c./windows/dnt pung.dll not a windows image is valid. Second: error loading c/windows/dntpung.dll %1 is not an application valid win 32.

  • with smart Photo 7520 booklet printing problems

    I have Windows 8 & just bought HP Photosmart 7520. I'm having a lot of problems with printing as a booklet. On the hand print Page , I chose "landscape", 1 page per sheet, & left binding. Also define the subset of booklet for "both parties".  I put t

  • If I update to windows 8.1 through my local account, all my files and all my information are saved?

    I have windows 8 on my desktop, I do not use a Microsoft account to connect to it, I use a local account. If I update to windows 8.1 all my files and all my information stored? and I will be able to connect to my local account without losing any of m