Here is what I am looking for:

Server 2003
Clients: XP, win2k

During logon I want the script to check \\servername\users\ for user ID if not found create share with that UID with read/write permissions for the user and local admin with full control.

If the share is found (\\servername\users\UID$) then map drive H: to that share.

At another one of our facilities a guy set this up that no longer works there, I have been trough all the code and changed what I need to but I can’t get it to work on my script at my faculty.

On their system in the users share there is usershares of course and two other folders, 1 DELETED USERS and 2 UTILITIES I am not numbering g them that’s how they are named. Deleted users contains you guessed it deleted users, now the utilities dir is interesting inside is:
KIX32.exe
KX16.dll
KX32.dll
KX95.dll
RMTSHARE.EXE
xcacls.exe
Readme_1st.doc that contains
-------------------------------------------------
Before using UserShare.bat for the first time, you must change the default scripting engine from Wscript to Cscript. To do this, type the following at a command prompt, and then press ENTER:

cscript.exe /h:cscript
-------------------------------------------------
I did this and it was successful

usershare.bat that contains
 Code:
::
:: User Share
::
:: This script creates a shared user directory and assigns the correct 
:: Permissions
::
:: The command syntax is:    usershare {UID} {UserName}
::
:: NOTE:  Server ID is hardcoded in three lines
::        Global Administrator's Group is hardcoded in one line
::        Drive letter to the Users folder is hardcoded in one line

@echo off
if not "%2" == "" goto continue
echo.
echo.
echo        Command syntax is:    usershare  {3-4 UID}  {6-1-1 UserName}
echo.
echo.
pause
goto end

:continue
@echo on

:: Open a Mapped Drive to the USERS root folder
net use r: \\twhtshr04\users

:: Create the User's Folder
mkdir r:\%2.%1

:: Set Share Permissions on the User’s Folder
rmtshare \\twhtshr04\%1$=D:\users\%2.%1 /g %1:f

:: Set NTFS Permissions on the User’s Folder
xcacls.vbs r:\%2.%1 /g “HCA\%1:f” /I copy /Q

:: Close the Mapped Drive to the USERS root folder
net use r: /delete

pause

:end


XCACLS.vbs


Edited by FullBoost (2007-05-25 05:58 PM)