The script looks great!!
Could you please clarif for my understanding what lines 15,18 and 19 are doing?
Main Topics
Browse All TopicsI work on a project that has a number of users from different companies on. I have been using the following powershell script for users that are not on the local domain. however i have come accross a company that will not allow the installaiton of Powershell + quest Active directory on the local machines. we have agreed that i can use VB however I don't know Vb well enough to create a simalar script any help would be great.
The Powersheel script simple connects to tyhe local AD as a predifined user with the permission to modify users password. the script then generates a random passowd and changes the user password to the new one.
The drives and printers are then mapped using user account and new password
Script
# Connect ot Ad for Password reset
$pwd = Convertto-securestring "EF:PVFp^_+&>p)09TeC?;TE)B
connect-QADService -service 'domain' -ConnectionAccount 'domain\controlaccount' -ConnectionPassword $pwd
#Determine user
$user = "Domain\" + $env:username
$userobj = get-qaduser $user
#Generate and set random Password
[Reflection.Assembly]::Loa
$pwd = [System.Web.Security.Membe
$userobj.setpassword($pwd)
#Connect drive
$net = new-object -com wscript.network
$net.MapNetworkDrive( "W:", "\\server\Shared", "false", $user, $pwd)
#$net.MapNetworkDrive( "U:", "\\server\Shared\arup", "false", $user, $pwd)
#Add Printer
$net.addwindowsprinterconn
$net.addwindowsprinterconn
$net.addwindowsprinterconn
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
i got the idea that the script work as a login script so
i use the ADSystemInfo object determine the distinguished name of the user logged on
then the script build the ADsPath for the logged-on user, finally the script bind to the user account in Active Directory.
of curse i'm not a big expert and smart one sad once : "msdn is your friend" so
http://msdn.microsoft.com/
You might need to use OpenDSObject for the connection to AD if the user doesn't have the password reset right themselves.
It just means a small change to the connection to the user.
I like MSDN too, relevant MSDN linkage for OpenDSObject:
http://msdn.microsoft.com/
Chris
Business Accounts
Answer for Membership
by: yehudahaPosted on 2008-12-15 at 13:54:20ID: 23178355
only from your description
i think this will do the job
Select allOpen in new window