GreenHouse Posted August 27, 2007 Posted August 27, 2007 (edited) #RequireAdmin ; Create all variables for DSADD command $DomainName = @LogonDomain $UserDN = '"CN=TCADMIN,DC=' & $DomainName & ',DC=COM"' $SamID = 'TCADMIN' $FN = 'TCADMIN' $Display = 'TCADMIN' $PWD = 'ImPoSsIbLeToGuEs1!' $Memberof = '"CN=Domain Admins,CN=Users,DC=' & $DomainName & ',DC=COM"' $DsaddUser = 'dsadd user ' & $UserDN & ' -samid ' & $SamID & ' -fn ' & $FN & ' -display ' & $Display & ' -pwd ' & $PWD & ' -memberof ' & $Memberof & ' -disabled no' RunWait(@ComSpec & " /c " & $DsaddUser) Allright folks, Anyone has a good idea what I can use or how I can validate this Domain Admin I added was really successfully added? I apreciate any suggestions. Thanks, - Pas PS: (And don't tell me to go to administrative tools and look! this is an AutoIt forum for peets sake! ) Edited August 27, 2007 by GreenHouse
jokke Posted August 27, 2007 Posted August 27, 2007 I think there is a ldap UDF on the forums, i suggest you look into that. Anb btw, script you are writing wont work on a standard Win2k machine since Win2k does not have any of the "ds" commands, as the standard setup. UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
GreenHouse Posted August 27, 2007 Author Posted August 27, 2007 jokke said: I think there is a ldap UDF on the forums, i suggest you look into that.Anb btw, script you are writing wont work on a standard Win2k machine since Win2k does not have any of the "ds" commands, as the standard setup.Jokke,Thanks for the reply. Yes i know it's for use on Windows 2000 Server or Windows 2003 Server only for the script I am writing will only be ran on either two.Thanks for your help I apreciate it.- Pas
weaponx Posted August 27, 2007 Posted August 27, 2007 (edited) Why aren't you just checking the exitcode of dsadd? http://technet2.microsoft.com/windowsserve...3.mspx?mfr=trueMaybe $RESULT = RunWait(@ComSpec & " /c " & $DsaddUser) If $RESULT Then MsgBox(0,"","Error adding user " & $Display) EndIf Edited August 27, 2007 by weaponx
GreenHouse Posted August 27, 2007 Author Posted August 27, 2007 Thanks a lot weaponx! That was very usefull information. (and poor research on my part). Thanks, - Pas
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now