Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem to connect to ActiveDi

Status
Not open for further replies.

NessaN

Programmer
Oct 18, 2007
3
MX
Hi everybody,

I´m trying to use "setpassword" from the intranet, but i have problems to find the correct adress to get connected to the active directory

' ---------------------------------------------------------'
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")

strContainer = "OU=Corporativo, "
strPassword = "q12345"
strContainer = strContainer & strDNSDomain

set objOU =GetObject("LDAP://" & strContainer )
' ---------------------------------------------------------'
'8007200a' this is the error in the last line

Thank you!
 
Take a look at the following FAQ. faq329-5688

Use the GetDistinguishedName function to bind to the user and then set the password.


I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thanks a lot for your answer, now i know the correct way to connect to Active =)

But i have a new problem with the security

Microsoft VBScript runtime error '800a0046'

Permission denied

i´m using the administrator user.
 
Sorry, my crystal ball is out for polishing. What code are you using and what line is giving you permission denied?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Sorry! =(
I´m trying to do 2 things
Set the User must change Password next logon and set new password, in both the problem is the same.

Set UserObj = GetObject("LDAP://CN=Nombre de Usuario,OU=NombreOU,OU=Teatros,DC=Midominio,DC=com,DC=mx ")

'UserObj.Setpassword "q12345"
'para la bandera del userMustChangePw
UserObj.Put "pwdLastSet", 0
UserObj.SetInfo <<------ Access denied
Set UserObj = Nothing

Thanks for your help =)
 
When setting the user password, it must match complexity requirements for the domain. You have the password line commented out. Was that intentional?

Verify the LDAP path to your user. Take a look at the function I referenced above as it will take the login name and grab the LDAP path for you.

Make sure you are running the script with Admin rights.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top