Solved

Windows 2000 Logon script w/ automatic OE configuration

Posted on 2004-08-22
3
203 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
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

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

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…
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

19 Experts available now in Live!

Get 1:1 Help Now