Hello
I want to backup my folders and datacenter from my old VIServer.
I found a very usefull script for that but it dosent show me the Datacenters:
filter Get-FolderPath {
$_ | Get-View | % {
$row = "" | select Path
$current = Get-View $_.Parent
$path = $_.Name
do {
$parent = $current
if($parent.Name -ne "vm"){$path = $parent.Name + "\" + $path}
$current = Get-View $current.Parent
} while ($current.Parent -ne $null)
$row.Path = $path
$row
}
}
$report = Get-VM | Get-Folderpath
$report | Export-Csv "c:\VM-with-FolderPath.csv" -NoTypeInformation
Is there a way to also write the datacenters in that csv sheet?
My next problem is that i want to creat new folders and also folders and Datacenters under these in my new VIServer.
There was also a usefull script i found: http://communities.vmware.com/message/1334740#1334740
But in that script "just" moves the already createt VMS in the createt folders.
And i have no idea how i can modify that script to creat folders and datacenters for me.
It would be great if there is an solution for my problem.