Solved

Create a user, homedir, and set attributes from a script

Posted on 2004-04-23
10
488 Views
Last Modified: 2010-04-13
Ok, I'm running Windows 2000, active directory.  I'm looking to make my life easier when creating users. I'd like a script that I can run that will prompt me (or just enter it at the command line) for username, first name, and last name, and do the rest.  I've tried a lot of batch file stuff but haven't been able to do everything I want all at once. So here's what I want to do...

Create the user with a username unrelated to their actual name, their first name and last name in their respective fields and together in the display name.
Set the option for User must change password at next logon
Add logon.bat to the Logon script: option
Add the user to a group.
Then, create a folder, share it (hidden) and grant access to the user, and admins.
The share needs to be accessible by both Win98 and 2k/xp clients.
Additionally, if I can add two other groups with specific rights, that'd be great too.

Thanks in advance!
0
Comment
Question by:salvagbf
  • 6
  • 4
10 Comments
 
LVL 7

Expert Comment

by:PaulADavis
ID: 10902659
check out the ldif utility...
0
 
LVL 6

Author Comment

by:salvagbf
ID: 10902711
I have, I use it at the beginning of the year to add 250+ students to the network.  That needs a text file to import from though and I don't believe it supports the use of variables, I'd have to edit the text file and type in the name and username a bunch of times, which kind of defeats the purpose of saving time.  Do you know if ldif works for adding to a group, or adding logon.bat to the logon script, or anything else I mentioned in the question? Thanks!
0
 
LVL 6

Author Comment

by:salvagbf
ID: 10902731
-Update-

Currently I know I can use 'net user' to create the user, but that doesn't set any options like 'User must change pw on next logon' etc..  I have a vb script for adding the logon.bat file.  I can use rmtshare for sharing their folders.  I just haven't figured out a way to streamline it all and fill in the gaps I'm missing.  I've tried checking MS technet scripting center but don't know enough about vbs to make the parts work together to do what I need.
0
 
LVL 7

Expert Comment

by:PaulADavis
ID: 10902770
well you can use ldif to create homedir, set the drive letter, and to add group membership....

but i understand what you are saying.... you want something that would allow you to only edit one or two lines...

0
 
LVL 6

Author Comment

by:salvagbf
ID: 10902845
Do you know where I can look to find how to do what you mentioned with ldif?
0
[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

 
LVL 7

Accepted Solution

by:
PaulADavis earned 500 total points
ID: 10903110
dn: CN=Administrator,CN=Users,DC=company,DC=com
memberOf: CN=Group Policy Admins,CN=Users,DC=company,DC=com
memberOf: CN=Enterprise Admins,CN=Users,DC=company,DC=com
memberOf: CN=Schema Admins,CN=Users,DC=company,DC=com
memberOf: CN=Administrators,CN=Builtin,DC=company,DC=com
memberOf: CN=Domain Admins,CN=Users,DC=company,DC=com

homeDirectory: \\xxxxxxx\xxxxxxx
homeDrive: x:




0
 
LVL 7

Expert Comment

by:PaulADavis
ID: 10903173
http://ldapadmin.sourceforge.net/

this seems interesting... it has the option to add logon script...
0
 
LVL 7

Expert Comment

by:PaulADavis
ID: 10903188
if you can use a test machine, see if you can enter a logon script in ldif.....

Script:   %u.cmd
0
 
LVL 7

Expert Comment

by:PaulADavis
ID: 10903332
or rather... script: xxxxxx
0
 
LVL 6

Author Comment

by:salvagbf
ID: 10953152
Thanks, I'll check out what you mentioned and get back to you next week.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Application Deployment - Simple 7 640
Windows timing on domain Pcs 4 443
Windows Foriegn Disk 3 130
windows explorer 21 172
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

15 Experts available now in Live!

Get 1:1 Help Now