Windows ME / 98 clients - net use to hidden share
Top  Previous  Next


Task

·Create accounts  
·Creates home directories  
·Create a hidden share for each home directory  
·Use a logon script with "net use" to map home directories to each users hidden share  

1) Create the home directory root on the server


·Example: "e:\users". The home directory root is the directory on the server where sub directories for all users will be created. The file system on the drive you choose MUST be NTFS!  

2) Create a logon script - the logon script connects the users to their home directory when they log on

·Locate the netlogon folder on your server (Example: C:\WINNT\SYSVOL\sysvol\D22\scripts)  
·Right click in the folder and choose new text document in the pop-up menu, name it "studw9x.bat".  
·Right click "studw9x.bat", choose edit.  
·Insert this line -  

@net use w: /home

·Save "studw9x.bat".  

3) Cut & paste this script -

[Settings_Begin]
BatchSettings.Delimiter=TAB
SET AccountName=%col2%    // %AccountName% instead of %col2% below = easier to change column
SET FullName=%col1%
SET Password=%col3%
BatchSettings.MarkerCol=4

SET ADDomainPath=dc=com/dc=acme/dc=D2
SET ADOU=Students
SET ADOUPath=%ADDomainPath%/ou=%ADOU%

SET HomeDir=%servername%\%AccountName%$
SET ScriptName=studw9x.bat

SET HomeRoot=e:\users
SET HomePermissions=%AccountName%:F administrators:F System:F
SET IDGroup=Students
SET IDGroupDesc=Students
[Settings_End]

[Machines_Begin]
\\EDU8      NT PDC    
[Machines_End]

[Batch_Begin]
AD.OU.Create %ADDomainPath%,%ADOU%   
$i AD.Group.Create Global,%ADOUPath%,%IDGroup%,%IDGroupDesc%   
Data.Loop   
 AD.Account.Create %ADOUPath%,%AccountName%,%AccountName%,%Password%   
 AD.Account.SetProperty %ADOUPath%/cn=%AccountName%,FullName,%FullName%   
 AD.Account.SetProperty %ADOUPath%/cn=%AccountName%,AccountDisabled,No   
 AD.Account.SetProperty %ADOUPath%/cn=%AccountName%,PWMustChange,No   
 AD.Account.SetProperty %ADOUPath%/cn=%AccountName%,PWNeverExpires,Yes   
 AD.Account.SetProperty %ADOUPath%/cn=%AccountName%,LoginScript,%ScriptName%   
 AD.Account.SetProperty %ADOUPath%/cn=%AccountName%,HomeDirectory,%HomeDir%   
 AD.Group.AddObject %ADOUPath%/cn=%IDGroup%,%ADOUPath%/cn=%AccountName%   
 DOS md %HomeRoot%\%AccountName%   
 DOS echo y| cacls %HomeRoot%\%AccountName% /G %HomePermissions%   
 DOS net share %AccountName%$=%HomeRoot%\%AccountName%   
Data.Endloop   
[Batch_End]

[Undo_Batch_Begin]
Data.Loop   
 AD.Account.Delete %ADOUPath%,%AccountName%   
 DOS net share %AccountName%$ /delete /y   
  // (The /y switch is used to force deletion of shares with connected users)    
 DOS echo y| rd %HomeRoot%\%AccountName%\ /s   
 // The /s switch causes rd to remove all directories and files in the specified directory   
Data.Endloop   
[Undo_Batch_End]

[Data_Begin]
   acc1   pass1   
   acc2   pass2   
[Data_End]


4) Edit the script

·Domain name = "D2.acme.com" -> "SET ADDomainPath=dc=com/dc=acme/dc=D2".  
·Server name = "\\EDU8" -> listed in the [Machines] section.  
·Use the "ADOU" variable to specify destination OU.  
·Edit the line "Set HomeRoot=xxxx" in the [Settings] section and insert your own home directory root path. Example: "Set HomeRoot=e:\users"  
·Edit the [Data] section, enter account names in column 2 and passwords in column 3  
·Save the script  

5) Run the script

·Click "Run Batch"  

6) Verify the result

·Set up the Windows ME / 98 Workstation, try try to log on  



·Right click "Network Neighborhood"  
·Click "properties/configuration/client for MS networks/properties"  
·Check "log on to Windows NT domain"  
·Enter the NT domain name of your server  
·Reboot the machine  
·Log on to the workstation using one of the accounts created above  
·Check the drive mapping  

7) Remove accounts, home directories, user files and shares from the server

·Start SetupBatcher  
·Open the file with the accounts you want to delete  
·Click "Remove Markers"  
·Click "Run Undo Batch"