Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Translating an NT script to VBScript

Status
Not open for further replies.

brent01

Technical User
Jul 11, 2001
32
GB
I have been working on an NT script 'user setup' script.

It should prompt for user input for an NT user id, a users Christian name, and a users Surname. The input from these are set as variables.

The script then creates 4 new folders (1 folder + 3 sub folders)on a server name HTMOA2. The fisrt folder is the same name as the users NT id.

A New share is the created, again the share has the same name as the users NT id. The new share then has it's permissions set. Giving Adminstrators full control and the user change permissions.


The use is then added to the 3 groups - LSEU, HTM-All & HTM-Department.

Finally the users logon script path is then set.

Here is the script -

@echo off
SET /P NTID=What is users NTID?
echo users NTID is %NTID%
SET /P FIRSTNAME=What is users first name?
SET /P FIRSTNAME=What is users surname name?
net use z:\\htmoa2\d$
mkdir \users\%NTID%
mkdir \users\%NTID%\Exdata
mkdir \users\%NTID%\Wordata
mkdir \users\%NTID%\Ppdata
rmtshare \\htmoa2\%NTID%$=d:\users\%NTID% /remark:"%FIRSTNAME% %LASTNAME%"
rmtshare \\htmoa2\%NTID%$ /remove htm\everyone
rmtshare \\htmoa2\%NTID%$ /grant htm\administrators:fc lseu\%NTID%:c
net group LSEU %NTID% /add/HTM
net group HTM-All %NTID% /add/HTM
net group HTM-Department %NTID% /add/HTM
net user bloggs /scriptpath:\\htmoa2\c$\system32\Repl\Import\Scripts\htm-logon.bat /homedir:\\htmoa2\bloggs$


I haven't completely tested the script yet so it's probably incorrect, and I'm sure somebody will tell me. However I hope it gives an idea of what I'm trying to achieve. Is it possible to the same kind of thing using VBscript? I am especially interesting in trying to use VBcript to replace the 'Net User' line, as this is what is causing me the main problem. The Net User command works, but you have to execute the command from the server console itself. As I want to be able to run the script succesfully from any PC, this is no good.

Can anybody help. Thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top