Page 1 of 1 1
Topic Options
#25627 - 2002-07-22 03:52 PM How to remove the current Microsoft Exchange Server service and add new one?
Bongjoon Offline
Fresh Scripter

Registered: 2002-07-19
Posts: 6
Hi, guys.

I'd like to remove the current Microsoft Exchange Server service from the existing Mail(outlook, Default profile) Profile. After that, I want to add new one, which is also Exchange Server service to the same Mail profile.

I know it sounds stupid, but please don't ask me why I need it. I was told to find a way to do the actions by Logon Script.

If you can help me, I'll appreciate it.
Thank you.

Top
#25628 - 2002-07-22 03:59 PM Re: How to remove the current Microsoft Exchange Server service and add new one?
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Do you need to remove the old service, or simply repoint it at a new server/mailbox name?

I have an old script somewhere that repointed the Personal Address Book to a new path - it might be of some use.

code:
;Check whether the migration has been run before - only continue if not
IF READVALUE("HKEY_LOCAL_MACHINE\Software\GNIComms\MigratePab","Status")
GOTO END
ENDIF

;First we check the default mail profile in use
$DefaultProfile = READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles","DefaultProfile")

;Now we hunt through the configured services for the Personal Address Book entries
$Index = 0
:Loop1
$ServiceName = ENUMKEY("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\$DefaultProfile\", $Index)
IF @ERROR = 0
IF READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\$DefaultProfile\$ServiceName","001e3001") = "Personal Address Book"
$PabPath = READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\$DefaultProfile\$Servicename","001e6600")
IF @ERROR = 0
GOTO MigratePab
ENDIF
ENDIF
$Index = $Index + 1
GOTO Loop1
ENDIF

;This subroutine will actually copy the PAB file currently in use to the new location (Home directory, etc)
;and then repoint the users mail profile to the copy. The original will be left intact - just in case it is
;needed. It can be removed later if there are no issues.

:MigratePab
$NewLocation = "\\server\share\@USERID.pab" ;This will be set properly for the live script
COPY $PabPath $NewLocation
$Nul = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\$DefaultProfile\$ServiceName","001e6600","$NewLocation","REG_SZ")
IF $Nul = 0
$Nul = ADDKEY("HKEY_LOCAL_MACHINE\Software\GNIComms\MigratePab")
$Nul = WRITEVALUE("HKEY_LOCAL_MACHINE\Software\GNIComms\MigratePab","Status","Migrated PAB successfully on @DATE at @TIME.","REG_SZ")
ENDIF

;Send email confirmation in addition to local machine registry tag
GLOBAL $Subject
$Subject = "Confirmation: PAB successfully migrated for @USERID to $NewLocation
GLOBAL $Message
$Message = ""
CALL "%0\..\GNISCRIPTS\sendmail.kix"

:END
EXIT

You would have to manually check the service ID for the Exchange Server services, or simply enumerate the registry keys looking for the name of the old server and replacing it where necessary.

You can ignore the sendmail.kix part at the end of this - its just a script that calls Postie.exe using a preconfigured setup, and nearly all my scripts use it to send me automated updates and info

Hope this might offer some ideas, though.

[ 22 July 2002, 16:02: Message edited by: Breaker ]
_________________________
================================================
Breaker


Top
#25629 - 2002-07-22 04:18 PM Re: How to remove the current Microsoft Exchange Server service and add new one?
Bongjoon Offline
Fresh Scripter

Registered: 2002-07-19
Posts: 6
Thank for you advice, but the funny thing is they want to remove the old Microsoft Exchange Server(I mean, service not profile) and add new one.

I guess I have to explain what is going on here.
They have the old mail server and want to remove it from the network and add a new one with the same server.

The problem they are facing is that after they disconnected the old server and added a new server(same server name) to the network, whenever they tried to open Outlook, it doesn't recognize the new server even though there is only one server(same name).
Only after they configure the mail setting from the control panel(remove the Microsoft Exchange Server service from the existing profile and add a new one to the profile), outlook recognize the new server.

That is why they want to simulate the configuration using Logon Script, because they don't want to do the same thing over and over again manually for all the computers in the company.
They still want to keep other configuration such as personal folder and personal address book, etc.

I'm not sure whether I explaing the problem well enough.

Thanks you for your help in advance.

Top
#25630 - 2002-07-22 04:26 PM Re: How to remove the current Microsoft Exchange Server service and add new one?
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
OK, now I understand. I think (not absolutely certain, though) that you will actually need to delete and recreate the profile completely, not just replace the service.

I'm not sure it was such a good idea to replace the old server with one of the same name, as any other boxes in your Exchange organisation will start to have orphaned directory entries and issues with addressing, system public folders, replicated address books etc...

That said, you'll want to look into the use of a couple of tools supplied with Outlook, Newprof.exe and Profgen.exe and search TechNet and this BB for examples of how to set up an Outlook profle in our logon script. I would hazard a guess that you can delete the old profile by deleting its registry keys.
_________________________
================================================
Breaker


Top
#25631 - 2002-07-22 04:39 PM Re: How to remove the current Microsoft Exchange Server service and add new one?
Mark Bennett Offline
Getting the hang of it

Registered: 2001-10-10
Posts: 70
I had problems trying to change Exchange settings in the registry. There was a lot of keys that appeared to be generic that ended up being unique.

I fixed a similar problem by shelling out to the MLCFG32.CPL then using SendKey combinations. You can enumerate the user's name with the macros and I had a very high success rate (I did include a few pauses to be certain tasks had completed and some SetFocus commands)!

Mark

Top
#25632 - 2002-07-22 05:17 PM Re: How to remove the current Microsoft Exchange Server service and add new one?
Bongjoon Offline
Fresh Scripter

Registered: 2002-07-19
Posts: 6
I guess I confused you.

It is right that they are trying to replace the service, not the profile.

Since they wanted to use the same exchange server name, I thought there would be no need to replace services or change the mail setting from the control panel. (I don't know much about Exchange server)

But they found that somehow they had to reconfigure the service( manually remove the current service and add a new server with the same server name to the current profile through the mail setting properties in contraol panel) to make outlook recognize the new server.

So that is why they want me to write some script that actually simulates the effects that happened when they did it manually by hand.

Top
#25633 - 2002-07-22 06:25 PM Re: How to remove the current Microsoft Exchange Server service and add new one?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Read these instructions on how to move an Exchange server from one box to another one:
Appendix A - Exchange 2000 Move Server Method
Appendix A - The Ed Crowley Exchange 5.5 Server Move Method
_________________________
There are two types of vessels, submarines and targets.

Top
#25634 - 2002-07-22 10:35 PM Re: How to remove the current Microsoft Exchange Server service and add new one?
Bob Deerinwater Offline
Starting to like KiXtart

Registered: 2002-05-05
Posts: 101
Loc: Covina California
WE HAD THE SIMILAR INSTANCE WHEN I CHANGED EXCHANGE SERVER (NEW SERVER SAME NAME)ABOUT A YEAR AND A HALF AGO. PEOPLE COULD NOT LOG IN WHAT WE FOUND IS IF YOU DELETED THE LAST CHARACTER IN OUR EXCHANGE SERVERS NAME AND THEN ADDED THE CHARACTER BACK AND THEN DID A CHECK NAME ALL WAS FINE. YOU MIGHT WANT TO TRY THIS. STILL ALOT OF WORK BUT WAS EASIER THAN RECRAETING THE WHOLE PROFILE.
Top
#25635 - 2002-07-23 03:54 PM Re: How to remove the current Microsoft Exchange Server service and add new one?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Bob:

No need to SHOUT! [Wink]

BTW, http://www.swinc.com/resource/exchange.htm has very good FAQs about anything Exchange-related. The 'Ed Crowley...Method' parts are the standard ways to accomplish said tasks and are regularly referenced in Exchange nbewsgroups.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1183 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.062 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org