I am making sure of that $CurrentPowerCLIConfig = Get-PowerCLIConfiguration -Scope Session if ($CurrentPowerCLIConfig.DefaultVIServerMode -ne "Multiple") { Set-PowerCLIConfigur...
See more...
I am making sure of that $CurrentPowerCLIConfig = Get-PowerCLIConfiguration -Scope Session if ($CurrentPowerCLIConfig.DefaultVIServerMode -ne "Multiple") { Set-PowerCLIConfiguration -DefaultVIServerMode Multiple -Confirm:$false | Out-Null }
This code indeed works, thanks! There's only a problem when you connect to multiple VIservers (in my case 8). More often than not it will return me this error: Exception calling "CreateObjec...
See more...
This code indeed works, thanks! There's only a problem when you connect to multiple VIservers (in my case 8). More often than not it will return me this error: Exception calling "CreateObjectScheduledTask" with "2" argument(s): "The object has already been deleted or has not been completely created" At D:\Scripts\ScheduleSnapshot.psm1:160 char:5 + $scheduledTaskManager.CreateObjectScheduledTask($vm.ExtensionData ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : VimException How can I adjust the code so it automatically finds the right viserver? Btw. VMware should create some cmdlets for scheduled tasks don't you think?