Ghost21 Posted May 12, 2010 Share Posted May 12, 2010 When I do something like this Const $ADS_NAME_INITTYPE_GC = 3 Const $ADS_NAME_TYPE_NT4 = 3 Const $ADS_NAME_TYPE_1779 = 1 If @error Then Exit $oMyError = ObjEvent("AutoIt.Error", "ComError") $objRootDSE = ObjGet("LDAP://RootDSE") If @error Then Else $objTrans = ObjCreate("NameTranslate") $objTrans.Init($ADS_NAME_INITTYPE_GC, "") $objTrans.Set($ADS_NAME_TYPE_1779, @LogonDomain) $objTrans.Set($ADS_NAME_TYPE_NT4, @LogonDomain & "\" & $User) $strUserDN = $objTrans.Get($ADS_NAME_TYPE_1779) $UserObj = ObjGet("LDAP://" & $strUserDN) I keep getting a error message show up The requested action with this object has failed.: $objTrans.Set($ADS_NAME_TYPE_1779, @LogonDomain) $objTrans.Set($ADS_NAME_TYPE_1779, @LogonDomain)^ ERROR I have put in error trapping but it still seems to quit .... Is it a networking issue ? Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 12, 2010 Share Posted May 12, 2010 (edited) RFC 1779 names look like "dc=MySubDomain,dc=MyDomain,dc=com", and I don't think that's what you get from @LogonDomain (it gives you the NetBIOS name). If you're going to use that, use $ADS_NAME_TYPE_NT4 for the type. Edited May 12, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
water Posted May 13, 2010 Share Posted May 13, 2010 (edited) When I do something like thisConst $ADS_NAME_INITTYPE_GC = 3 Const $ADS_NAME_TYPE_NT4 = 3 Const $ADS_NAME_TYPE_1779 = 1 If @error Then Exit $oMyError = ObjEvent("AutoIt.Error", "ComError") $objRootDSE = ObjGet("LDAP://RootDSE") If @error Then Else $objTrans = ObjCreate("NameTranslate") $objTrans.Init($ADS_NAME_INITTYPE_GC, "") $objTrans.Set($ADS_NAME_TYPE_1779, @LogonDomain) $objTrans.Set($ADS_NAME_TYPE_NT4, @LogonDomain & "\" & $User) $strUserDN = $objTrans.Get($ADS_NAME_TYPE_1779) $UserObj = ObjGet("LDAP://" & $strUserDN)I keep getting a error message ... What are you trying to do? You know there is an Active Directory UDF available? For download please see my signature. If there is a function missing I will be glad to incorporate it into the UDF. Edited May 13, 2010 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
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