To create a new service in server 2003 or xp you use the sc.exe tool.
REMEMBER TO ADD A SPACE AFTER EVERY EQUAL SIGN!!!! THIS IS VERY IMPORTANT!
sc create "my service" binPath= "c:\myfile.exe" type= "own" start= "auto" DisplayName= "my service" error= "normal"
Obviously replace “my service” with whatever you want to call the service and “myfile.exe” with the file you’d like to make a service.
I cam across two amazing article the other day detailing how to do some great stuff from the windows command line.
synjunkie knows his shit:
Command-Line-Ninjitsu Command-Line Kung Fu
I stumbled upon it because I was about to format a server but wanted to retain this information:
All local groups/users and their respective permissions for . . . → Read More: Howto: Back up Server 2003 Users Groups Shares Permissions Program Names Network Settings
Installing Server 2003 x64 on a Poweredge 2950 with Perc 5i / 6i (LSI logic) RAID drivers.
This was a nightmare but i finally figured out how to get windows setup to read my RAID drive (In my case i couldn’t use Dell’s System Build and Update Utility disc because it wants to format the . . . → Read More: poweredge 2950 server 2003 install raid driver and repair windows
Need to start the plug and play service in server 2003?
sc config PlugPlay start= auto
net start "PlugPlay"
First you need to install the IIS 6.0 Migration Tool
For each Web site and virtual directory on the source server, you must create a corresponding Web site and virtual directory on the target server. Later in the migration process, you will copy the content into these Web sites and virtual directories.
Create the Web sites and virtual directories by completing the following steps:
1. Create the Web sites and home directories on the target server.
2. Create the virtual directories.
Now let’s create a .bat file:
cd "Program Files (x86)"
cd "IIS Resources"
cd "IIS 6.0 Migration Tool"
iismt.exe server-name w3svc/1 /serverbindings 127.0.0.1:80:dev-site2.example.com /siteid 1 /configonly
iismt.exe server-name w3svc/2 /serverbindings 127.0.0.1:80:qa-site2.example.com /siteid 2 /configonly
iismt.exe server-name w3svc/3 /serverbindings 127.0.0.1:80:stage-site2.example.com /siteid 3 /configonly
iismt.exe server-name w3svc/4 /serverbindings 127.0.0.1:80:site2.example.com /siteid 4 /configonly
iismt.exe server-name w3svc/5 /serverbindings 127.0.0.1:80:loadtest2.example.com /siteid 5 /configonly
Adsutil2.vbs append w3svc/1/serverbindings "127.0.0.1:80:dev-site.example.com"
Adsutil2.vbs append w3svc/2/serverbindings "127.0.0.1:80:qa-site.example.com"
Adsutil2.vbs append w3svc/3/serverbindings "127.0.0.1:80:stage-site.example.com"
Adsutil2.vbs append w3svc/4/serverbindings "127.0.0.1:80:site.example.com"
Adsutil2.vbs append w3svc/5/serverbindings "127.0.0.1:80:loadtest.example.com"
Adsutil2.vbs append w3svc/1/serverbindings "127.0.0.1:80:dev-site.preview.example.com"
Adsutil2.vbs append w3svc/2/serverbindings "127.0.0.1:80:qa-site.preview.example.com"
Adsutil2.vbs append w3svc/3/serverbindings "127.0.0.1:80:stage-site.preview.example.com"
Adsutil2.vbs append w3svc/4/serverbindings "127.0.0.1:80:site.preview.example.com"
Adsutil2.vbs append w3svc/5/serverbindings "127.0.0.1:80:loadtest.preview.example.com"
Adsutil2.vbs append w3svc/4/serverbindings "127.0.0.1:80:site.asp.example.com"
Adsutil2.vbs append w3svc/5/serverbindings "127.0.0.1:80:cms.preview.example.com"
You will need to replace 127.0.0.1 with the ip of the server you want to copy the config settings to. The second part using adsutil2.vbs is used to add addtional host headers to site names
. . . → Read More: Howto: Migrate IIS Sites to Another Server
The easiest way to change the IIS site id is to create a .bat file like this: (Assuming that 1135282223 was the id of your current site and 5 was the ID you’d like to have)
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs STOP_SERVER W3SVC/1135282223
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs MOVE W3SVC/1135282223 W3SVC/5
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs START_SERVER W3SVC/5
What is %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs ? It is a ulility included in IIS.
List of utilities included with IIS can . . . → Read More: Howto: Change siteid of website in IIS 6.0
In this case my error looked something like:
"The Tomcat6 service was unable to log on..."
This service account does not have the necessary user right "Log on as a service."
Because I was running Tomcat6 on an active directory domain controller (windows server 2003) I was unable to grant “Log on as a service” rights.
Run the service as “NT AUTHORITY\NetworkService” (no quotes) with a blank password.
Login as a Service with NT . . . → Read More: HowTo: Fix Event Log Error “service account does not have the necessary user right “Log on as a service.”