Solved

Windows 2000 Logon script w/ automatic OE configuration

Posted on 2004-08-22
3
200 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
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
Eagle6990 earned 300 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Worked perfectly. 50 extra points for having the solution sitting at my desk when i arrived in work :)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now