All Forums >> [Scripting] >> WSH & Client Side VBScript >> A lil help with a DC finder script. Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I'm currently in the process of making a HTA to create users with, this i actually have all done, and they can make users and so forth. My only problem is that they have to be able to put on homedrives, and homefolders on the users, which is no problem either, the problem is the right's on the folder.
My domain is a pretty large one i'd say, we have 1 root domain with 5 subdomains, and this HTA has to be able to create users, and homefolders cross-domain. When i am in domain A, and create a user in Domain B, i get everything created as it should, but when i put on rights to the folder (am using fileACL atm, the EXE) it gives me an error No SID for the user, the reason for that beeing is that the DC i get the user from when trying to set the rights, is in domain A (hence the reply my domain hasn't replicated yet).
In fileACL i can set a targetDC, which is where it takes the user from, now here's the problem. I want to locate the nearest DC in the domain i have created the USER, i don't think i can use a random DC cause we have differen't sites in our infrastructure and could wind up having the same problem. And i don't want to hardcode anything in our HTA, cause we have made it untill now without doing that, and it would be silly cause i now there is a solution to this problem outthere.
i thought of doing something like taking one of the servers i get back here, but again i don't know what happens if i get a DC outta the site where i created the user. What would be really cool is if i could get the server where the user was created (don't want to hardcode the place where the user get's created).
Does anyone have any great idea's on how i get going again, this problem is actually the last outta many problem which i have solved in my HTA, and when i get this done it's finished.