
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
NOTE: MY POSTINGS REFLECT MY OWN VIEWS AND DO NOT NECESSARILY REPRESENT THE VIEWS OF MY EMPLOYER, ACCENTURE.
DIFFICULTY LEVEL: INTERMEDIATE
Assumes having taken the class SSNF and has good intermediate level of knowledge and/or familiarity with Scripting in ServiceNow.
Here is a question I get asked a LOT in my Discovery and Orchestration classes: How do I easily get rid of a MID Server that I have (pick one):
- Accidentally installed!
- Needed to rename!
- Changed a wrapper configuration! (If you make changes to the wrapper-override.conf file you will need to remove and re-add the MID Server service to get the changes to take affect.)
- Other!
So, here is a quick-and-clean way to do the deed:
1. Bring up a Windows Explorer window and navigate to your ServiceNow Mid Server Agent directory. For me this was:
c:\ServiceNow\Vancouver_PDI\agent
2. Open up the Conf folder. There is where the Wrapper service configuration files are located. We will be looking up our specific server name.
3. Open up the wrapper-override.conf file with your favorite text editor.
4. Look for wrapper.name=. Make a note of the value. For me it was snc_mid_pdi.
Note: For the optional steps also make note of the wrapper.displayname.
5. Close the editor.
OPTIONAL STEPS (6-10)
The following steps are to validate you have the right service targeted for removal. If you are positive you can skip to step 11
6. From Microsoft Windows Start type services.msc and hit enter. The services window will be displayed.
7. Sort by name and search for the displayname you wrote down from the wrapper config in the previous steps.
8. Double-click on that service to open up the properties window.
9. Note the Service name. It should be the same as was in the wrapper config.
This is how it appears on my machine:
10. Close the properties window, and then the services window.
11. From a Microsoft Windows Start
a. Type cmd. You will see the Command Prompt App appear in the search list.
b. Right-click on Command Prompt application and choose "Run as administrator". This will keep a bunch of annoying popup boxes from appearing.
c. The command window will be displayed.
12. Change the directory to your MID Server location. Mine is midserver1, and you want to be in the agent directory to issue the commands.
a. Type: cd \<<my server location>>\agent - and press enter
b. Type: dir - to bring up a directory
13. Now issue the stop command to kill the MID Server process.
a. stop.bat
14. To delete the MID Server you will need to issue the sc delete command. The midserver name from the wrapper config you made a note of in the earlier steps. For a different server that I removed it was snc_mid (which is the default name unless you mess with it prior to install).
a. sc delete <<server name>>
Note: This removes the MID Server service and now you are ready to start fresh.
15. Now you can make modifications to the configuration or whatever. Running start.bat will re-install the MID Server service with your changes.
a. start.bat
And you are done! Yes, it is that simple!
For more information on the Microsoft sc.exe command: SC
Enjoy!
Steven Bell.
If you find this article helps you, don't forget to log in and mark it as "Helpful"!
Originally published on: 1-21-2016 11:15 AM
I updated the code and brought the article into alignment with my new formatting standard.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.