Tech: Programmatically adding users to Microsoft Virtual Server 2005

Ben Armstrong published a new script example, this time for automatically adding users to Virtual Server:

Dim ace

set objVs = wscript.CreateObject(“VirtualServer.Application”)
Set objSecurity = WScript.CreateObject(“VirtualServer.VMSecurity”)

set objSecurity = ObjVs.Security

Set ace = objSecurity.AddEntry(“DOMAIN\Username”,vmAccessRights_Allowed)
ace.WriteAccess = True
ace.ReadAccess = True
ace.ExecuteAccess = True
ace.DeleteAccess = True
ace.ReadPermissions = True
ace.ChangePermissions = True

ObjVs.Security = objSecurity

Read the original post for updates and comments from Ben.