Solved

Ldap Impersonation (kinda?)

Posted on 2004-09-28
8
674 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
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 12173865
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now