Automated installs

Gerald W. Carter jerry at Eng.Auburn.EDU
Tue Oct 7 12:32:10 GMT 1997


Louis Mandelstam wrote:
> 
> 
> What do you do with the Win95 PC's
> HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProfileList to get it to
> contain an appropriate username entry, with a ProfileImagePath pointing
> to the user's profile on the server?
> 
> Do you clear the ProfileList somehow, and generate a .REG file which you
> import from the logon script?
> 

Here is the portion of the login script that deals with the 
ProfileImagePath key...

****************smb.conf
[homes]
        root preexec = /etc/local/netlogon/buildhome %U
        wide links = no
        preexec = /etc/local/utmppipe %U %d 7 %M
        postexec = /etc/local/utmppipe %U %d 8 %M
        comment = Home Diectories
        browseable = yes
        writeable = yes
        path = /export/home/%U
        create mode = 0700
 

****************root preexec script
# Copy the SB214 standard "Start Menu" and "Desktop"
/etc/local/netlogon/buildprofile $user
 
# Does the username.bat exists in the user's home directory?
if [ ! -f /export/home/$user/username.bat ]; then
   
   touch /export/home/$user/username.bat
   echo "set USERNAME=$user" >> /export/home/$user/username.bat
   unix2dos /export/home/$user/username.bat
/export/home/$user/username.bat 2> /dev/nul
   chown $user /export/home/$user/username.bat
 
fi
 
if [ ! -f /export/home/$user/profile.inf ]; then
 
   sed "s/%USERNAME%/$user/g" /etc/local/netlogon/profile.inf | unix2dos
> /export/home/$user/profile.inf
   chown $user /export/home/$user/profile.inf
 
fi

*********************username.bat
set USERNAME=cartegw

*********************profile.inf
;
;  logon.inf
;
;  This is copied into the temp directory, then user and
station-specific
;  string definitions are copied onto the end.
;
; C:\WIN95\rundll.exe setupx.dll,InstallHinfSection DuringLogon 132
C:\Temp\log
on.inf
; C:\WIN95\rundll.exe setupx.dll,InstallHinfSection PostLogon 132
C:\Temp\logon
.inf
 
[version]
signature="$CHICAGO$"
 
;;;
;;; DuringLogon is performed during logon.bat, near the end.
;;;
 
[DuringLogon]
AddReg = DuringLogon.AddReg
 
[DuringLogon.AddReg]
 
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\ProfileList\cartegw",
"ProfileImagePath", , "C:\WINDOWS\Profiles\cartegw"
 

*********************login script
rem ---------- set the USERNAME environment variable
:username
call h:\username.bat
echo %USERNAME%
%WINBOOTDIR%\rundll.exe setupx.dll,InstallHinfSection DuringLogon 132
h:\profile.inf

rem ---------- copy the roaming user profile to the local disk
:profile
echo Copying local cached copy of user profile...
mkdir c:\windows\profiles\%USERNAME%
echo user.dat
copy "h:\user.dat" c:\windows\profiles\%USERNAME%\user.dat /v /y > NUL 
echo Start Menu
xcopy "h:\start menu\*.*" "c:\windows\profiles\%USERNAME%\Start
Menu\*.*" /v /s /e /y > NUL 
echo Desktop
xcopy "h:\desktop\*.*" "c:\windows\profiles\%USERNAME%\Desktop\*.*" /v
/s /e /y > NUL 
echo Recent Documents
xcopy "h:\recent\*.*" "c:\windows\profiles\%USERNAME%\Recent\*.*" /v /s
/e /y > NUL 
echo Network Neighborhood
xcopy "h:\nethood\*.*" "c:\windows\profiles\%USERNAME%\Nethood\*.*" /v
/s /e /y  > NUL
 
:end
echo Done!

********************************************
The username.bat and profile.inf files are generic ones that have the 
username inserted during the root prexec script.

Couple of inconsitencies in Win95 need to be mentioned.

1.	Even if Registry editing tools are disabled in the registry
	(policy editor), inf files still seem to work.

2.	If you disable the shut down option in the Start menu, you
	can still perform the same option by running the Task Manager
	and selecting 'Shutdown Windows' from the File menu.

Also have a batch file that clean the temp space on the disk and the
c:\windows\Profiles diectory at boot up.  I copy the User profile to
the local disk.  It has been noted that you can just point the 
ProfileImagePath key to h:\ assuming that your are mounting the user's
home directory at H:\ every time.  Don't know about using a UNC name
here.
Could someone elso comment one this?

Actually, it is harder to do this kind of stuff in our public labs here
because of the way we have the machines locked down.  The hard disks are 
writed-protected using a security software package and a copy of the
system 
registry is restored upon bootup.  In a less secure environment, it
would 
be a lot easier to make changes to the local system using login script
and 
INF files.


j- 
________________________________________________________________________
                          Gerald ( Jerry ) Carter	
Engineering Network Services                           Auburn University 
jerry at eng.auburn.edu             http://www.eng.auburn.edu/users/cartegw

       "...a hundred billion castaways looking for a home."
                                  - Sting "Message in a Bottle" ( 1979 )
________________________________________________________________________


More information about the samba mailing list