Context: Windows7 64bit, ActiveDirectory, Windows Server 2003
I’m trying to get the code given by Microsoft on their page GetSecurityDescriptor method of the Win32_Printer Class (Windows) to work. I’m a bit curious to know how the double instantiation of winmgmts works out, viz (from their code)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate, (Security)}!\\" & strComputer & "\root\cimv2")
Set objWMIService = GetObject("winmgmts:")
I would have thought that the second instance would clobber the first. This would seem to be borne out by the fact that no matter what server name I put in strComputer, I still get a list of the printers on my computer.
Has anyone had any joy getting the DACL of a server-connected printer using VBScript?
you are right and there is more than one thing wrong with that script, here is a working version
=>> on my domain this gives the ACL twice per user, could be caused by the way security is given