To use this function add it to the class library file named PluginVCHostSystemService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: PluginVCHostSystemService.ts
Description: Orchestrator Function to Toggle Hardening on a vCenter Virtual Machine
Public Function: HardeningEnable
publicHardeningEnable(obVcVirtualMachine:VcVirtualMachine):boolean{
letblnResult:boolean=this.HardeningToggle(obVcVirtualMachine,true);
returnblnResult;
}Public Function: HardeningDisable
publicHardeningDisable(obVcVirtualMachine:VcVirtualMachine):boolean{
letblnResult:boolean=this.HardeningToggle(obVcVirtualMachine,false);
returnblnResult;
}Private Function: HardeningToggle
privateHardeningToggle(obVcVirtualMachine:VcVirtualMachine,blnEnable:boolean):boolean{
letobjProperties:Properties=newProperties();
objProperties.put("tools.setinfo.sizeLimit",1048576);
objProperties.put("RemoteDisplay.maxConnections",2);
objProperties.put("vmsafe.enable",!blnEnable);
objProperties.put("RemoteDisplay.vnc.enabled",!blnEnable);
objProperties.put("isolation.tools.setGUIOptions.enable",!blnEnable);
objProperties.put("isolation.device.edit.disable",blnEnable);
objProperties.put("isolation.device.connectable.disable",blnEnable);
objProperties.put("isolation.tools.ghi.autologon.disable",blnEnable);
objProperties.put("isolation.bios.bbs.disable",blnEnable);
objProperties.put("isolation.ghi.host.shellAction.disable",blnEnable);
objProperties.put("isolation.tools.ghi.protocolhandler.info.disable",blnEnable);
objProperties.put("isolation.tools.unity.taskbar.disable",blnEnable);
objProperties.put("isolation.tools.unityActive.disable",blnEnable);
objProperties.put("isolation.tools.unity.windowContents.disable",blnEnable);
objProperties.put("isolation.tools.unity.push.update.disable",blnEnable);
objProperties.put("isolation.tools.vmxDnDVersionGet.disable",blnEnable);
objProperties.put("isolation.tools.guestDnDVersionSet.disable",blnEnable);
objProperties.put("isolation.tools.dispTopoRequest.disable",blnEnable);
objProperties.put("isolation.tools.trashFolderState.disable",blnEnable);
objProperties.put("isolation.tools.ghi.trayicon.disable",blnEnable);
objProperties.put("isolation.tools.unity.disable",blnEnable);
objProperties.put("isolation.tools.unityInterlockOperation.disable",blnEnable);
objProperties.put("isolation.tools.getCreds.disable",blnEnable);
objProperties.put("isolation.tools.hgfsServerSet.disable",blnEnable);
objProperties.put("isolation.tools.ghi.launchmenu.change",blnEnable);
objProperties.put("isolation.tools.memSchedFakeSampleStats.disable",blnEnable);
objProperties.put("isolation.tools.copy.disable",blnEnable);
objProperties.put("isolation.tools.dnd.disable",blnEnable);
objProperties.put("isolation.tools.paste.disable",blnEnable);
letarrVcOptionValue:VcOptionValue[]=this.ConvertPropertiesToVcOptionValueArray(objProperties);
try{
this.ReconfigureExtraConfig(obVcVirtualMachine,arrVcOptionValue);
returntrue;
}
catch (objException){
returnfalse;
}
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
