Hi, in that code, do you have a Sales OU, and have you changed the DC elements in the Set objContainer line?
Change this:
On Error Resume Next
Set objContainer = GetObject _
("LDAP://ou=Sales,dc=NA,dc=fabrikam,dc=com")
to this:
Set objRootDSE = GetObject("LDAP://RootDSE")
strOU = "OU=Sales,OU=Departments,"
Set objContainer = GetObject("LDAP://" & strOU & objRootDSE.Get("defaultNamingContext"))
and then we'll go from there if you get an error.
Regards,
Rob.
stubar
ASKER
Thanks Rob
Getting error 80040E14 on the " Set objRecordSet = objCommand.Execute" line in the Function GetGPOName.
This to me implies the function is not binding to AD. What do you think?
Put the previous code back in, with the On Error catch removed and it was still coming back to that line.
Stuart
RobSampson
OK, so above this line
Set objRecordSet = objCommand.Execute
if you put this:
MsgBox objCommand.CommandText
and then post that query string, I can see if the command is malformed at all, and help you get that working.
Change this:
On Error Resume Next
Set objContainer = GetObject _
("LDAP://ou=Sales,dc=NA,dc
to this:
Set objRootDSE = GetObject("LDAP://RootDSE"
strOU = "OU=Sales,OU=Departments,"
Set objContainer = GetObject("LDAP://" & strOU & objRootDSE.Get("defaultNam
and then we'll go from there if you get an error.
Regards,
Rob.