VMware Cloud Community
davidjenkinsATp
Contributor
Contributor
Jump to solution

Update Client Settings

I'm trying to update my systems to allow copy and paste and a few other things.  The settings get changed but don't seem to apply until I open the configuration in the web browser and close it.  I figure the browser thing is 'saving' the settings.  How can I go about getting my settings to save in my powershell script?

PowerShell Code

$folder = Get-Folder "LAB" | where {$_.Parent.Name -eq "DEVELOPMENT"}

$vms = $folder | Get-VM

ForEach ($vm in $vms){
Write-Host -ForegroundColor Yellow "Checking settings for $($vm.Name)"
    $advancedsettings = Get-AdvancedSetting -Entity $vm

    if ($advancedsettings.Name -notcontains "suspend.disabled"){
    "suspend.disabled NOT FOUND"
    $vm | New-AdvancedSetting -Name "suspend.disabled" -Value "TRUE" -Confirm:$false -Force
    }

    if ($advancedsettings.Name -notcontains "isolation.tools.copy.disable"){
    "isolation.tools.copy.disable NOT FOUND"
    $vm | New-AdvancedSetting -Name "isolation.tools.copy.disable" -Value "FALSE" -Confirm:$false
    }

    if ($advancedsettings.Name -notcontains "isolation.tools.paste.disable"){
    "isolation.tools.paste.disable NOT FOUND"
    $vm | New-AdvancedSetting -Name "isolation.tools.paste.disable" -Value "FALSE" -Confirm:$false
    }

}


0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try with the Reload method.

$vm.ExtensionData.Reload()

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Try with the Reload method.

$vm.ExtensionData.Reload()

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
davidjenkinsATp
Contributor
Contributor
Jump to solution

I tried applying it to a system I haven't 'touched' with the web interface.  That didn't seem to do anything.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

What exactly do you mean by "Open the configuration"?
Because the Web Client nor the HTML5 client allows you to edit the advanced settings when the VM is powered on.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

davidjenkinsATp
Contributor
Contributor
Jump to solution

That was it.  I had to have the system shutdown while running the command.  Thank you.

0 Kudos