' This Script adds users from a text file and set up a ' Default profile path, Home directory etc, Then it shares ' the home directory and assigns the appropriate access rights for the home directory. ' This script is kinda sloppy but it worked for me. Const ForReading = 1, ForWriting = 2, ForAppending = 3 Set FileSys = CreateObject("Scripting.FileSystemObject") Set TxtFile = FileSys.OpenTextFile("c:\Userlist.txt", ForReading, TristateFalse) Set Network = WScript.CreateObject("WScript.Network") Set Shell = WScript.CreateObject("WScript.Shell") Set DomainObj = GetObject("WinNT://Domain") Set HomeServerObj = GetObject("WinNT://Domain/Server/lanmanserver") LogonScript = "default.bat" InitialPassword = "newuser" UserHomeUpperDir = "\\Server\users" WshNetwork.MapNetworkDrive "x:", "\\Server\users" WshNetwork.MapNetworkDrive "Y:", "\\Server\Profiles\" If TxtFile.AtEndOfLine <> True then UserNameVar = TxtFile.ReadLine If TxtFile.AtEndOfLine <> True then FirstNameVar = TxtFile.ReadLine If TxtFile.AtEndOfLine <> True then LastNameVar = TxtFile.ReadLine If TxtFile.AtEndOfLine <> True then GroupVar = TxtFile.ReadLine Do While TxtFile.AtEndOfLine <> True UserHome = UserHomeUpperDir & "\" & UserNameVar Set NewUser = Domain.Create("user",UserNameVar) NewUser.FullName = FirstNameVar & " " & LastNameVar & " " & MiddleInit NewUser.HomeDirectory = UserHome NewUser.Profile = "\\Server\Share\" & UserNameVar NewUser.LoginScript = LogonScript NewUser.Description = "Description" NewUser.SetInfo NewUser.SetPassword(InitialPassword) Set NewUser = Nothing FileSys.CreateFolder("x:\" & UserNameVar) FileSys.CreateFolder("Y:\" & UserNameVar) UserShare = UserNameVar & "$" set newshare = HomeServerObj.create("fileshare", UserNameVar & "$") newshare.path="E:\Users\" & UserNameVar newshare.setinfo Do While GroupVar <> "NextUser" Set GroupObj = GetObject("WinNT://domain/" & GroupVar, group) GroupObj.add("WinNT://domain/" & UserNameVar) GroupObj.setinfo GroupVar = TxtFile.ReadLine Loop Shell.run "cacls x:\" & UserNameVar & " /t /g " & UserNameVar & ":F",1,true Shell.run "cacls x:\" & UserNameVar & " /e /t /g administrator:F",1,true If TxtFile.AtEndOfLine <> True then UserNameVar = TxtFile.ReadLine If TxtFile.AtEndOfLine <> True then FirstNameVar = TxtFile.ReadLine If TxtFile.AtEndOfLine <> True then LastNameVar = TxtFile.ReadLine If TxtFile.AtEndOfLine <> True then GroupVar = TxtFile.ReadLine loop Txtfile.close WScript.echo "All Done"