Page 1 of 1 1
Topic Options
#91754 - 2003-03-13 11:19 PM ADSI User Question
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Can I make an ADSI call with an account other than the one that is active on the computer... basically I am saying can I pas credentials into my ADSI call so that it would use credentials other that the users?

Is that confusing?

Thanks
_________________________
Austin Henderson

Top
#91755 - 2003-03-13 11:29 PM Re: ADSI User Question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See fnWMIAuthentication() - Authenticates against a local or remote WMI provider . You can then execute against the remote computer under the newly provided credentials.
_________________________
There are two types of vessels, submarines and targets.

Top
#91756 - 2003-03-13 11:36 PM Re: ADSI User Question
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Looks good.. just not sure what I am talking about. Let us say that you have DOMAIN\User1 that is a Domain User. For whatever reason you want that account to be able to set something using ADSI.. we will say maybe change a first name or something on an account... and you give that user an alternate userid and password to use for such instances.. it seems very weird I know I am just curious if it can be done.. or if it will always use the account that is on the machine.. another example is if you want a user to modify AD properties but is not logged into a member computer or maybe with a member account.. he/she would need to supply credentials for this..

Maybe I am confused on the UDF and I will be the first to admit it if I am..

Thanks
_________________________
Austin Henderson

Top
#91757 - 2003-03-14 05:04 AM Re: ADSI User Question
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
quote:
ADsOpenObject and IADsOpenDSObject::OpenDSObject
[This is preliminary documentation and subject to change.]

The major advantages of using ADsOpenObject and IADsOpenDSObject::OpenDSObject are the following:

The ability to specify an alternate user name and password to authenticate to the directory.
The ability to use encryption to protect the data exchange over the network between your application and the directory server.
It is recommended that you use the logged on user's credentials whenever possible. However, if you need to supply alternate credentials, you can use these Open methods. If you choose to bind using alternate credentials, do not cache the password. You can use the same alternate credentials in multiple bind operations by specifying the user name and password for the first bind operation and then specify only the user name to make subsequent binds. The system sets up a session on the first call and uses the same session on subsequent bind calls as long as the following conditions are met:

You specify the same user name in each bind operation.
You use serverless binding or bind to the same server in each bind operation.
You keep the session open by holding on to an object reference from one of the bind operations. The session is closed when the last object reference is released.
ADsOpenObject and IADsOpenDSObject::OpenDSObject take advantage of the Windows NT Security Support Provider Interfaces (SSPI) to allow flexibility in authentication options. The major advantage of using these interfaces is to provide different types of authentication to Active Directory clients and to encrypt the session. Currently, ADSI does not allow certificates to be passed in. Therefore, you can use SSL for encryption and then Kerberos, NTLM, or simple authentication, depending on how the flags are set on the dwReserved parameter. Note that you cannot ask for a specific SSPI provider in ADSI, although you will always get the highest preference protocol. In the case of a Windows 2000 client binding to a Windows 2000 server, the protocol is Kerberos. For a Windows NT 4.0 client binding to a Windows 2000 server, the protocol is NTLM. Not allowing a certificate for authentication is fine in the case of a Web page, because authentication occurs prior to running the Web page.

Although Open operations allow you to specify a user and password, you should use the current logged on user context to bind and leverage that user context to control access to the directory. If you use ADsOpenObject or IADsOpenDSObject::OpenDSObject to bind to an object, specify NULL for both username and password to use the current logged-on user's credentials. When an application binds using a user's credentials, that application can access only the objects and object properties to which that particular user has access. If the user does not have read access to an object, the application never sees the object when accessing the object in that user's context.

Finally, if you want to bind with no authentication, you can use the ADS_NO_AUTHENTICATION flag. No authentication means that ADSI attempts to bind as an anonymous user to the target object and performs no authentication. This is equivalent to requesting anonymous binding in LDAP and means "Everyone" is the security context.


_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.069 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org