Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
I don't believe you can use a wild card for local accounts using the WinNT provider, at least not that I've seen. Perhaps you could enumerate through all the groups, get the members, use the InStr function to see if it is an account similar to the one you're looking for, add it to an array or dictionary, then loop through this collection with the names you need and add it to the admin group.
something like this:
//EDIT: Removed <span> tags
< Message edited by dm_4ever -- 5/24/2007 4:28:09 AM >
Thanks for the code and explanation...I've been working with it now since you posted it up but cant seem to grasp the inclusion of my code with it...???
I admit to not being to aware of the differing variables you've used but...
I used my earlier code but to no avail...if I expressley name the accounts (i.e "/AccPC1") then it's added pretty much as before...but if I try and use the captured variable from the array I cant seem to grasp the concept...
if i change my code to:
set objGroup = GetObject("WinNT://" & strComputer & "/Administrators") set objUserAdd = GetObject("WinNT://" & strComputer & strUsrName)
it returns a variable not defined error?
The problem I have here i guess is understanding how to take a name found in the search and stored in the array and passing it to the: