Solved

Windows 2000 Logon script w/ automatic OE configuration

Posted on 2004-08-22
3
220 Views
Last Modified: 2010-04-14
I have about 50 client machines connected to a samba 3 server using domain/roaming profiles and a logon script to set the time and map drives.

Im having a slight problem with the script when trying to setup users email accounts ( the email server is hosted on the samba3 server also ). When the user logs in for the first time i have a registry file that runs itself and sets a user up with his/her email address automatically in outlook express. The problem is the %USERNAME% varibale will not work and outlook express has               %USERNAME%@server.mydomain.com instead of the acutal user that is logged into the domain. Thus their email account will not work.

Is there an easier way of automatically setting up email accounts when the user logs into the domain ? If not whats the problem with the reg file below ?

thanks,
llain3000

   REGEDIT4

   [HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\info@server.mydomain.com]
   "DCEmail"=dword:00000002
   "POP3 Server"="server.mydomain.com"
   "POP3 Port"=dword:0000006e
   "SMTP Server"="server.mydomain.com"
   "SMTP Port"=dword:00000019
   "Connection Type"=dword:00000001
   "POP3 User Name"="%USERNAME%@server.mydomain.com"
   "SMTP Display Name"="%USERNAME%@server.mydomain.com"
   "SMTP Email Address"="%USERNAME%@server.mydomain.com"
   "SMTP Reply To Email Address"="%USERNAME%@server.mydomain.com"
   "SMTP Organization Name"=""
   "Account Name"="%USERNAME%@server.mydomain.com"
   "POP3 Timeout"=dword:0000003c
   "SMTP Timeout"=dword:0000003c
   "POP3 Secure Connection"=dword:00000000
   "Leave Mail On Server"=dword:00000000
   "POP3 Skip Account"=dword:00000000
   "POP3 Prompt for Password"=dword:00000000
   "SMTP User Name"="%USERNAME%@server.mydomain.com
   "SMTP Use Sicily"=dword:00000003
   "SMTP Secure Connection"=dword:00000000
   "SMTP Split Messages"=dword:00000000
   "SMTP Prompt for Password"=dword:00000000
0
Comment
Question by:llain3000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Eagle6990 earned 300 total points
ID: 11866755
By default registry files don't support variables.  With XP clients you could use the "Reg" command to add entries directly into the registry.  Since 2K doesn't support either of these, we have to do a little more.

An idea I had was to use a regular batch file and redirect the output to create your registry file on the fly and then import that one.  In my example it is located in the Windows directory but you can put it whereever you want and rename whatever you want it.

I would put this in your login script.

echo REGEDIT4 > %systemroot%\Email.reg

echo    [HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\info@server.mydomain.com] >> %systemroot%\Email.reg
echo    "DCEmail"=dword:00000002 >> %systemroot%\Email.reg
echo    "POP3 Server"="server.mydomain.com" >> %systemroot%\Email.reg
echo    "POP3 Port"=dword:0000006e >> %systemroot%\Email.reg
echo    "SMTP Server"="server.mydomain.com" >> %systemroot%\Email.reg
echo    "SMTP Port"=dword:00000019 >> %systemroot%\Email.reg
echo    "Connection Type"=dword:00000001 >> %systemroot%\Email.reg
echo    "POP3 User Name"="%USERNAME%@server.mydomain.com" >> %systemroot%\Email.reg
echo    "SMTP Display Name"="%USERNAME%@server.mydomain.com" >> %systemroot%\Email.reg
echo    "SMTP Email Address"="%USERNAME%@server.mydomain.com" >> %systemroot%\Email.reg
echo    "SMTP Reply To Email Address"="%USERNAME%@server.mydomain.com" >> %systemroot%\Email.reg
echo    "SMTP Organization Name"="" >> %systemroot%\Email.reg
echo    "Account Name"="%USERNAME%@server.mydomain.com" >> %systemroot%\Email.reg
echo    "POP3 Timeout"=dword:0000003c >> %systemroot%\Email.reg
echo    "SMTP Timeout"=dword:0000003c >> %systemroot%\Email.reg
echo    "POP3 Secure Connection"=dword:00000000 >> %systemroot%\Email.reg
echo    "Leave Mail On Server"=dword:00000000 >> %systemroot%\Email.reg
echo    "POP3 Skip Account"=dword:00000000 >> %systemroot%\Email.reg
echo    "POP3 Prompt for Password"=dword:00000000 >> %systemroot%\Email.reg
echo    "SMTP User Name"="%USERNAME%@server.mydomain.com >> %systemroot%\Email.reg
echo    "SMTP Use Sicily"=dword:00000003 >> %systemroot%\Email.reg
echo    "SMTP Secure Connection"=dword:00000000 >> %systemroot%\Email.reg
echo    "SMTP Split Messages"=dword:00000000 >> %systemroot%\Email.reg
echo    "SMTP Prompt for Password"=dword:00000000 >> %systemroot%\Email.reg

regedit /s %systemroot%\Email.reg
0
 
LVL 17

Expert Comment

by:Eagle6990
ID: 11866787
Oh yeah, at the end of that you might want to put in a

del %systemroot%/Email.reg

just to cleanup.
0
 

Author Comment

by:llain3000
ID: 11870934
Worked perfectly. 50 extra points for having the solution sitting at my desk when i arrived in work :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This article outlines the struggles that Macs encounter in Windows-dominated workplace environments – and what Mac users can do to improve their network connectivity and remain productive.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question