Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Windows 2000 Logon script w/ automatic OE configuration

Posted on 2004-08-22
3
Medium Priority
?
229 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 1200 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

876 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