Hello,

I'm writting a script that chage attribute on an AD user.

On my local workstation it work fine.

But i need to run it from a IIS service, and i have an
error "-2147463168" every time i do GetObject.

Here is a piece of the code :

(MyDomain, MyAdminAccount and MyPassword are here for
exemple)


Set oCon = CreateObject("ADODB.Connection")
oCon.Provider = "ADsDSOObject;User
ID=MyDomain\MyAdminAccount;Password=MyPassword;"
oCon.Open "Active Directory Provider"

Set oCmd = CreateObject("ADODB.Command")
Set oCmd.ActiveConnection = oCon

oCmd.CommandText = "select AdsPath from 'LDAP://" &
Domaine & "' where objectClass = 'group' AND
cn='Utilisateurs VPN'"
Set oRs = oCmd.Execute

If Not oRs.EOF Then
oRs.MoveFirst
End If

GroupeVPN = oRs.Fields("AdsPath").Value

' --> Here i get the AdsPath without problem

Set objGroup = GetObject (GroupeVPN)

' --> Here i've got that -2147463168 error.


Could some one help me with this ?