Solved

Ldap Impersonation (kinda?)

Posted on 2004-09-28
8
677 Views
Last Modified: 2006-11-17
Hello,

During a rollout of SP2 we are moving everyone into a new OU (sp2liveou). When testing the code it works fine for me and happily moves machines about as I have the rights to do that.. However, the 12,000 users don't. Can anyone tell me how to change my fairly simple script to use a specific domain account we already have to do the move on the users computer. The script is in VBscript and is currently using a .movehere to move the computer account. I am looking for a kind of impersonation for ldap if that (or any of this ramble) makes sense.

Many thanks,

Jamie.
0
Comment
Question by:purejamie
  • 5
  • 3
8 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 12171458
Youn can always use the RUNAS command.  Here's a link to more details.
http://www.tek-tips.com/faqs.cfm?fid=2760
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12171493
If you want to do it all from inside VB, to hide the password, then here's another possibility.  See the accepted answer.
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20550779.html?query=runas&topics=93
0
 

Author Comment

by:purejamie
ID: 12173712
Thanks a lot fot the links BlueDevilFan, iif all else fails I will use the RUNAS command, but as the whole thing is running from inside an MSI I would prefer to do the whole lot in the script. Is there anyway to attach an username/password to an LDAP string or something similar in VB?

Cheers,
Jamie.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 12173865
0
 

Author Comment

by:purejamie
ID: 12178510
Thanks for the link, almost there! However, does anyone know how to do the dso stuff in VBscript; all the links i have seen have been for VB (dimimg dso as etc.) can't seem to get it working in VBscript... Any ideas? Thanks again...
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12178676
This works for me.  

Set DSO = CreateObject("DSOleFile.PropertyReader")
Set Props = DSO.GetDocumentProperties(FileName)

You then get the properties by referencing Props.PropertyName
0
 

Author Comment

by:purejamie
ID: 12178732
Classic. All working, many thanks BlueDevilFan.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12179159
You're welcome!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question