I made a couple of changes here:
strComputer = "." 'Current Computer
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_UserAccount Where LocalAccount = False")
If isEmpty(colItems) Then...
Thank you.
It states that the error is in the 7th line, the part where it says:
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2\")
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2\")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_UserAccount Where LocalAccount = False") 'Searches all non-local clients
For Each objItem in...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.