Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADSI Objects
Message
From
29/03/2001 14:02:04
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00488611
Message ID:
00489996
Views:
118
I am using VFP 7. I'm not sure how to specify the interface, but I tried oUser = GetObject("WinNT://Nordam/sketchum,user","IADsUser") and got an error. If I don't specify the second parameter (which is what I was doing before), it works fine (except that I can't get to the properties I need).



>Steve,
>In VFP 6 there is no way to specify an interface. You get the default. In VFP 7, createobjectex and getobject have been modified to allow the specification of an interface.
>
>As for what you are trying to do, I haven't read the whole thread but not all properties documented under MSDN are supported in all providers. For example, the following properties are supported under the NT Namespace for the IADsUser interface:
>
>Description
>FullName
>
>AccountExpirationDate
>BadPasswordAttempts
>HomeDirDrive
>HomeDirectory
>LastLogin
>LastLogoff
>LoginHours
>LoginScript
>LoginWorkstations
>MaxLogins
>MaxPasswordAge
>MaxStorage
>MinPasswordAge
>MinPasswordLength
>objectSid
>Parameters
>PasswordAge
>PasswordExpired
>PasswordHistoryLength
>PrimaryGroupID
>Profile
>UserFlags
>
>NDS (Novell) supports some of these and others. Perhaps the EmployeeID is one such property.
>
>HTH.
>
>>I found some documentation that looks like I need to use the IADsUser interface to get access to these properties. I'm not sure if using the IADsUser interface means that I need to use a different method to create my object. I found the following C++ sample.
>>
>>IADsUser *GetUserObject(LPWSTR uPath)
>>{
>> IADsUser *pUser;
>> HRESULT hr = ADsGetObject(uPath,IID_IADsUser,(void**)&pUser);
>> if (FAILED(hr)) {return NULL;}
>> BSTR bstr;
>> hr = pUser->get_FullName(&bstr);
>> printf("User: %S\n", bstr);
>> SysFreeString(bstr);
>> return pUser;
>>}
>>
>>Can someone tell me how I would do this in VFP? I have tried referring to the properties directly and always get errors. I even tried calling the "get" methods in the format that the C++ code does it, and I get errors.
>>
>>
>*snip*
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform