{"id":18653893,"url":"https://github.com/powershellcrack/powercli-clonetemplatestodatacenters","last_synced_at":"2025-11-05T16:30:31.145Z","repository":{"id":111449973,"uuid":"139500921","full_name":"PowerShellCrack/PowerCLI-CloneTemplatesToDataCenters","owner":"PowerShellCrack","description":"Using PoweCLI to clone templates across multiple vCenter's that are not linked. ","archived":false,"fork":false,"pushed_at":"2018-11-29T12:10:50.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T14:11:47.014Z","etag":null,"topics":["clone-templates","powercli","vcenter"],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PowerShellCrack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-02T22:25:45.000Z","updated_at":"2018-11-29T12:10:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f0d71a9-39fd-419d-b611-199050acea17","html_url":"https://github.com/PowerShellCrack/PowerCLI-CloneTemplatesToDataCenters","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPowerCLI-CloneTemplatesToDataCenters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPowerCLI-CloneTemplatesToDataCenters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPowerCLI-CloneTemplatesToDataCenters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PowerShellCrack%2FPowerCLI-CloneTemplatesToDataCenters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PowerShellCrack","download_url":"https://codeload.github.com/PowerShellCrack/PowerCLI-CloneTemplatesToDataCenters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239467263,"owners_count":19643601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clone-templates","powercli","vcenter"],"created_at":"2024-11-07T07:13:27.102Z","updated_at":"2025-11-05T16:30:31.105Z","avatar_url":"https://github.com/PowerShellCrack.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clone Templates To DataCenters using PowerCLI\nUsing PoweCLI to clone templates across multiple vCenter's that are not linked. \n\n# Pseudocode\n     - Login into a specified source vCenter using credentials (prompt) or stored credentials (no prompt)\n     - This script will convert a template(s) to a VM (we can't clone a template, it must be converted first)\n     - If more than one destination vCenter is specified, clone multiple times for each transfer since you can only MOVE a VM \u003c--NOT WORKING YET\n     - Clone the VM using a incremental naming convention (eg. SVRTEMPLATE \u003e\u003e SVRTEMPLATE-01)\n     - Convert original VM back to template (so it can be used with VRA or deployments)\n     - Tag VM with Clone Attributes ('CloneStatus',‘CloneVersion','CloneDate') to identify VM as a cloning template and stop this script from running simutanously\n     - Login into a destination vCenter using credentials (prompt) or stored credentials (no prompt)\n     - Check If VM exists, then check their Clone Attributes.\n     - If VM is not validated continue \u003c--NOT WORKING YET\n     \n     - Convert any existing Template to VM's to get Clone Attributes, check validatation \u003c--NOT WORKING YET\n     - Determine if using Standard or Distributed switch, get a virtual port group (random)\n     - Find a host (random)\n     - Find Datastore specified\n     - Determine space avaliable in datastore \u003c--NOT WORKING YET\n     - Move VM to vCenter with progress bar (a long process)\n     - If move process took lonager than timeout, reauthenticate using credentials (prompt) or stored credentials (no prompt)\n     - Delete VM if not validated from source Clone Attributes (not template yet) \u003c--NOT WORKING YET\n     - Move VM to Template folder if exists\n     - Rename VM to original template name\n     - Covert VM back to Template\n     \n     \n# PARAMETERS\n     . PARAMETER SourceVC\n          Define source vCenter with Templates. Can be multiple (separate by commas within parenthesis)\n     . PARAMETER SourceTemplates\n          Define source Templates names. Must be exact. Can be multiple (separate by commas within parenthesis). \n          Default values are \"WINSVR2O16STD\" and \"WINSVR2012R2STD\"\n     .PARAMETER DestinationVCs\n          Define source destination vCenter to transfer Templates. Can be multiple (separate by commas within parenthesis)\n     .PARAMETER DestinationNetwork\n          Destination Virtual Network Port group name This uses Regex to search\n          Search for a datastore name that contains this value Default value is \"content\" \n          uses Regex to search\n\n     .PARAMETER TemplateFolder\n          Search for a folder in the datastore that contains this value Default is \"Template\"\n          This uses Regex to search.\n               If folder is not found, it will clone the template to root directory of cluster\n               If folder is not found but template is replacing an existing Template, it will move\n               the new template to that folder.\n     .PARAMETER UseVICredsFile\n          If defined, additionally define the CredFile parameter\n          If not defined, then credentials are stored with the prompt using Get-Credential commandlet.\n     .PARAMETER CredFile\n          Specify a location of the xml file.\n               If file path not found, then it defaults to users temp directory (eg C:\\Users\\Admin\\AppData\\Local\\Temp\\VICreds xml)\n               Use a PowerCLI stored credential command This will save a xml with host,username,encrypted password\n               Allows script to run with credentials without prompting mutiple times (if needed)\n               Before running script load credentials by running PowerCLI commandlet example:\n                    eg. New-VICredentialStoreItem -Host Passwrd1234 -File C:\\temp\\creds.xml\n          If not defined, then credentials are stored with the prompt using Get-Credential commandlet.\n     .PARAMETER ForceNewCreds\n          If UseVICredsFile switch used, can also force to load new credentials with this switch.\n          This WILL delete existing xml file if found\n               This is useful if multple destinations vCenters are used but all hosts are loaded in xml file.\n               Credentials can be the same\n     .PARAMETER StoreDifferentDestinationCreds\n          If UseVICredsFile switch used, can also force to load dffferent credentials for each host.\n     .PARAMETER CheckCloneStatus\n         When defined, this will check to see if custom VM attributes (for cloning) exists,\n         if not it will create them. Then it will set its value according to what stage it\n         is in the process\n         The custom attribute created are:\n             Clonestatus : In the script it will change the value from:\n                 Cloning,Moving,Completed\n             Cloneversion ; In the script it will check the version number and compare them\n                             before moving. This version should be updated by another script to get record of template versioning\n             CloneDate' : In the script it will change the value to the date the cloned image was last compeleted.\n\n         This is useful if the script crashes and never sets the date and leaves the Clonestatus to Cloning or Moving, \n         if the date is older than one day it will ignore the Attribute checks.\n     .PARAMETER KeepAlive\n         I found that if the moving of a VM takes longer than the PowerCLI Configuration\n         WebOperationTimeoutSeconds or Vcenter inavtivety timeout, the next Vm to move will fail.\n         This will set the WebOperationTimeoutSeconds to the below KeepAliveSecs and try to\n         re-authenticate to the vCenter on each move.\n     .PARAMETER KeepAliveSecs\n         Set timeout value for session for PowerCLI configuration\n         WebOperationTimeoutSeconds. Default is \"43200\" [12 hours]\n     .PARAMETER NoPingCheck\n         Ignores the ability to see if vcenter is conencted; this will be a WARNING. This is\n         only useful is ICMP is not allowed on the network.\n     .PARAMETER IgnoreCerts\n          Ignored non-trusted certs including self-signed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowershellcrack%2Fpowercli-clonetemplatestodatacenters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpowershellcrack%2Fpowercli-clonetemplatestodatacenters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpowershellcrack%2Fpowercli-clonetemplatestodatacenters/lists"}