Hi there, I often get into a situation where I need to know, inside a package, which role the local computer has. For example I have a package which deploys a backup software. For this software to work it is necesssary to add a pre-defined user-account to the group of local administrators. This, of cause, would fail on a domain controller as this machine does not have 'local' groups, so I need to skip these steps on domain controllers. At the moment this is done by adding hostname checks, but these checks will fail if there is a computer not named after out naming-convention. And this is, however, just _one_ example!
My suggestion is to add a new check to wpkg. This could be something like: <check type="host" condition="role" value="domaincontroller" /> <check type="host" condition="role" value="workstation,server" /> or similar. I have found some VB code which, with slight modifications, could be used: Function DomainRole(sNode) Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & sNode & "\root\cimv2") Set colComputer = oWMI.ExecQuery("Select DomainRole from Win32_ComputerSystem") For Each oComputer in colComputer iDR = oComputer.DomainRole Next Select Case iDR Case 0 DomainRole = "Standalone Workstation" Case 1 DomainRole = "Member Workstation" Case 2 DomainRole = "Standalone Server" Case 3 DomainRole = "Member Server" Case 4 DomainRole = "Backup Domain Controller" Case 5 DomainRole = "Primary Domain Controller" Case Else DomainRole = "Unknown" End Select End Function Regards, Malte
------------------------------------------------------------------------- wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/ _______________________________________________ wpkg-users mailing list wpkg-users@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/wpkg-users