HI,
Am having the error with following script to take clone for virtual machine
Could you please someone corrects the error
$VC='10.20.10.8'
$pwd = Get-Content C:\scripts\ap-vcs-credentials.txt | ConvertTo-SecureString
$credentials = New-Object System.Management.Automation.PsCredential “administrator@masscloudspace.local“, $pwd
Connect-VIServer -10.20.10.8 $VC
$vmName = 'MC-P-MailServer'
$cloneName = "$($)Varnikmail_Backup_$((Get-Date).ToString('MMddyyyy'))"
$oldCloneName = "$($)Varnikmail_Backup_$((Get-Date).AddDays(-2).ToString('MMddyyyy'))"
$ds = Get-Datastore | -Name 'Production_Backup'
$esx = Get-Cluster -VM $vmName | Get-VMHost | Get-Random
$start = Get-Date
Get-VM -Name $oldCloneName -ErrorAction SilentlyContinue |
Remove-VM -DeletePermanently:$true -Confirm:$false
$vm = New-VM -VM $vmName -Name $cloneName -Datastore $ds -VMHost $esx
$cloneEvent = Get-VIEvent -Entity $vm -Start $start |
where{$_ -is [VMware.Vim.VmClonedEvent] -and $_.Vm.Vm.Value -eq $vm.ExtensionData.MoRef.Value}
Your suggestions very much help full...
did you look in Local Security Policy/ Local Policies / Security options / Network Access : Do not allow storage of passwords and creds... set to disable.
HI Richie, Where i have to do this setup
Run secpol.msc, then go to Local Policies.
But that setting might be set by a GPO, and then you need to talk with your domain admins.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Let me try this.