Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Active Directory (Add/Edit) using VFP 9
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01242228
Message ID:
01242625
Views:
21
Hi Mike,

I actually was running that script outside of VFP. If I put brackets around it, I get a syntax error (from the script engine) and if I use parenthesis, it runs but I still get the same A referral was returned from the server error. :-(

>VFP needs brackets at this line.
>
objUser.Put("sAMAccountName", "SmithJohn")
>
>
>>Hi Naomi,
>>
>>I'm using the following code to attempt to create a new user in AD on the local machine (domain name is hhccas):
>>
>>
>>Set objOU = GetObject("LDAP://OU=management,dc=hhccas,dc=com")
>>Set objUser = objOU.Create("User", "cn=SmithJohn")
>>objUser.Put "sAMAccountName", "SmithJohn"
>>objUser.SetInfo
>>
>>
>>When I run the script, however, I get the following error:
>>"A referral was returned from the server"
>>
>>To be clear, the server that I am running the code on is located in another city. I am using VPN to connect to the network and then using Remote Desktop to connect to the server (inside the network), then copying the script to that server and running it from that server.
>>
>>Have you encountered the error before? Is it something to do with this line?:
>>
>>Set objOU = GetObject("LDAP://OU=management,dc=hhccas,dc=com")
>>
>>
>>Thanks!
>>
>>>>I've been tasked with populating a client's AD with records in a SQL table.
>>>>
>>>>I have found a ton of info about using .Net to do this, but I haven't been able to make it work.
>>>>
>>>>That said, I'm much more comfortable working in VFP and wanted to see if anyone else has done anything with adding/updating AD with VFP?
>>>>
>>>>Any info is appreciated....
>>>>
>>>>Thanks,
>>>
>>>Get http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=B4CB2678-DAFB-4E30-B2DA-B8814FE2DA5A and you'll find the scripts you need.
Previous
Reply
Map
View

Click here to load this message in the networking platform