How to recreate a missing service or reinstall a service with ITMS?
ITMS 8.x
Question
For some reason one of the default services is missing, corrupted, or crashing in NS. How can I remove/add them into the services?
Answer
The following steps are based on removing and reinstalling the default Altiris Services, which are:
Altiris File Receiver
Altiris Client Message Dispatcher
Altiris Service
These services are integrated on the 'AeXSvc.exe' located under ...\Program Files\Altiris\Notification Server\Bin.
1. First find where the affected service executable exists. In most cases by looking on the 'Properties' for that service, you should see the path and executable name for it. For example, "...\Program Files\Altiris\Notification Server\bin\aexsvc.exe" or for the Altiris Object Host is located under "...\Program Files\Altiris\TaskManagement\AtrsHost.exe".
If for some reason the service is missing completely from the Windows Services but it used to exist, then you can look under HKLM\System\CurrentControlSet\Services and check if there is still an entry for that service and check if it has a path. If there is not a path then try to find another server that has the service to take a look on the .exe and path that you need to use for the missing service.
2. Before removing and reinstalling any service (if it exists), check if the service has specific errors or issues with missing assemblies. Run the service in Console Mode. To run in console mode stop the desired service, in this case the Altiris Service, and run the following command:
<install drive>\Altiris\Notification Server\bin\AexSvc.exe –c
Note: This will start the service in a MS-DOS window allowing you to see any .NET errors that may be occurring during startup.
Note: If you see .NET errors referring to missing assemblies, in most cases by running a repair or install on the associated MSI should readd those assemblies. With NS7, all the MSIs used for installing all our products are located usually under ...\Program Files\Altiris\Symantec Installation Manager\Installs\Altiris.
3. If the service exists but it is not behaving right, crashing or not restarting, try to uninstall the service, in this case the Altiris Service, through one of two methods:
a) Run the following command:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" /u "<install drive>:\Program Files\Altiris\Notification Server\bin\aexsvc.exe"
Note: InstallUtil.exe is a Microsoft .NET utility, located under %WINDIR%\Microsoft.NET\Framework\v2.0.50727, which will remove any related assemblies.
Please also consider that with SMP 7.5 and 7.6 you may need to run this InstallUtil.exe under %WINDIR%\Microsoft.NET\Framework\v4.0.xxxx, usually 4.0.30319. Just make the appropiate changes references accordingly.
b) If the previous method does not remove the services, you can then use the following command to remove the services:
sc delete aexsvc.exe
4. Verify that the Services are removed. You will need to check the registry at HKLM\System\Current Control Set\Services and make sure that the service(s) key(s) is(are) gone. In this case the Altiris Service appears as AeXSvc. After the service has been removed, restart your server. If you try to install the service before restarting the server it is most likely that you will get a message saying that the desired service is marked for deletion, so you will not be able to reinstall it.
5. Reinstall the desired service (in this case the Altiris Services). This command will reinstall the services:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "<install drive>:\Program Files\Altiris\Notification Server\bin\aexsvc.exe".
Or for example, if you were missing the Altiris Object Host service, run "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "<install drive>:\Program Files\Altiris\TaskManagement\AtrsHost.exe".
Note: It may be necessary to reboot the server after the services are recreated.