![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Binding to a User Object with Alternate Credentials Is there a way to bind to a user object with alternate credentials? Here is the line I am using. ' arrADAccounts(intAccountIndex,2) is a 2D ' array that I am using from an ADO recordset ' with the distinguished name in element 2. Set objUser = GetObject _ ("LDAP://" & arrADAccounts(intAccountIndex,2)) ' I'd like to do this with alternate credentials objUser.SetPassword NEW_PASSWORD |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Binding to a User Object with Alternate Credentials "Bart Perrier" <bart_perrier@xxxxxx> wrote in message news:uYRPCsafJHA.4728@xxxxxx Quote: > Is there a way to bind to a user object with alternate credentials? Here > is the line I am using. > > ' arrADAccounts(intAccountIndex,2) is a 2D > ' array that I am using from an ADO recordset > ' with the distinguished name in element 2. > Set objUser = GetObject _ > ("LDAP://" & arrADAccounts(intAccountIndex,2)) > > ' I'd like to do this with alternate credentials > objUser.SetPassword NEW_PASSWORD > > ========= Const ADS_SECURE_AUTHENTICATION = &H1 strAdsPath = "LDAP://cn=Test User,ou=West,dc=MyDomain,dc=com" strUser = "MyDomain\MyUserName" strPassword = "xYz$312w" Set objNS = GetObject("LDAP:") Set objUser = objNS.OpenDSObject(strAdsPath, strUser, strPassword, ADS_SECURE_AUTHENTICATION) ========= However, it is not recommended that passwords, especially admin passwords, be hard coded in a script for security reasons. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Binding to a User Object with Alternate Credentials "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in message news:ez$Rh4afJHA.1252@xxxxxx Quote: > > "Bart Perrier" <bart_perrier@xxxxxx> wrote in message > news:uYRPCsafJHA.4728@xxxxxx Quote: >> Is there a way to bind to a user object with alternate credentials? Here >> is the line I am using. >> >> ' arrADAccounts(intAccountIndex,2) is a 2D >> ' array that I am using from an ADO recordset >> ' with the distinguished name in element 2. >> Set objUser = GetObject _ >> ("LDAP://" & arrADAccounts(intAccountIndex,2)) >> >> ' I'd like to do this with alternate credentials >> objUser.SetPassword NEW_PASSWORD >> >> > You can use the OpenDSObject method. For example: > ========= > Const ADS_SECURE_AUTHENTICATION = &H1 > > strAdsPath = "LDAP://cn=Test User,ou=West,dc=MyDomain,dc=com" > strUser = "MyDomain\MyUserName" > strPassword = "xYz$312w" > > Set objNS = GetObject("LDAP:") > Set objUser = objNS.OpenDSObject(strAdsPath, strUser, strPassword, > ADS_SECURE_AUTHENTICATION) > ========= > However, it is not recommended that passwords, especially admin passwords, > be hard coded in a script for security reasons. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > I do understand the security concern with doing this and I don't like this alternative, but I do appreciate the reminder. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Create an AD Group with Alternate Credentials | VB Script | |||
| Executing LNK files with alternate credentials | PowerShell | |||
| executing ps1 from a web browser, alternate credentials | PowerShell | |||
| running script with alternate credentials | PowerShell | |||
| PoSh Remote/Alternate Credentials | PowerShell | |||