Steven Erat's Blog Steven Erat Photography
 
 
Viewing By Entry
 
 

TalkingTree  Using AutoAdminLogin to automatically start ColdFusion on the commandline instead of Service

 

Here's a solution on how to configure Windows to automatically log on as Administrator and then start ColdFusion MX from the commandline using the batch file, all without any required user interaction. This solution is a response for a customer wishing to have this configuration so that when their machine enters a scheduled reboot overnight it can start itself in a manner that allows ColdFusion to run in a mode that will permit taking a thread dump at a later time when a user is around. To rephrase, the only value of this configuration is to be able to start ColdFusion in console mode after a machine reboot when no one is around.

Note that configuring Windows to automatically login as an Adminstrator account is a very serious security hazard and you probably shouldn't do this unless the machine is in a locked server room and you hold the keys, and there may be other security risks I hadn't thought of. However, it can be done. I don't know how to automatically lock the screen while the Administrator is automatically logged in, but if you know then please add a comment. In order for the cfstart.bat file to run in an interactive mode such that someone can come along and hit CTRL+BRK to generate a thread dump, a user must be logged in so that the console is accessible. The screen can be locked, but the user can't log off.

To get started, I followed the instructions listed in this Microsoft article on how to use AutoAdminLogon. This article assumes the following name/value pairs are set in the Windows Registry:

  • AutoAdminLogon
  • DefaultDomainName
  • DefaultUserName
  • DefaultPassword

However, I found that my system did not have the entry for DefaultPassword so I created it and entered the password in clear text, which the article mentions should be that way. Having AutoAdminLogon set to 1, and DefaultDomainName, DefaultUserName, & DefaultPassword all set, I rebooted the machine and confirmed that it automatically logged me on. Whenever tampering with the Windows Registry, be sure to make an export of either they individual key or the whole Registry first to use as a backup.

Then I created a new bat file in C:\CFusionMX7\bin\ called cfstart_output.bat. The only entry in this bat file was
cfstart.bat >> cfstart_outputfile.txt. Then I dragged the the cfstart_output.bat file to the Start menu in
Start > Programs > Startup. Programs in Startup will run as soon as a user logs in.

The ColdFusion MX 7 Application Server Service should be set to Manual or Disabled if you're planning to start while using the bat file.

Rebooting the system, I found it automatically logged me on and started ColdFusion MX 7 on the commandline, but since output was being appeneded to a file the console window remained blank. I tested CTRL+BRK a couple times, then used CTRL+C to stop the ColdFusion console window. I then examined the cfstart_outputfile.txt file to confirm that it did contain 2 thread dumps.

Again, this is a very insecure configuration so think twice before doing this. But if you're ok with this, it will work.

See also:
An easier way to take ColdFusion Thread Dumps

 


Comments

Here are some instructions for locking a Desktop via command line in Win2K:

http://www.windowsitpro.com/Article/ArticleID/1492...

Windows 2000 enables you to lock the workstation by typing the following command

C:\> rundll32.exe user32.dll,LockWorkStation

You could also use this as a shortcut on you desktop.

I'm pretty sure there are some command line programs you can download that will lock the desktop.

Your steps are still very risky, but if anyone is going to try it, at least attempt to lock the computer after the batch file has run.


Thanks for the tip and link! My customer wanted this type of solution so they must have been comfortable with the security risks, so I thought I'd just share for those that are curious.


 

 

Calendar

 
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Search This Site

 
This is an exact search only

About This Site

 
Adobe Alumni & Community Professional. Expert in ColdFusion, Flex, LCDS, Photoshop, Lightroom. Linux RHCE. Follow Me!. For my photography check out Boston Portrait Photographer.
More about me

Recent Entries

 
ColdFusion 9.01 Server Monito..

Recent Comments

 
Posted By Swagat:
Ben Forta, best-selling ColdFusion author is coming to India this August at India's largest Adobe Flash Platform Conference. Ben Forta will conduct a ...

Posted By Steve:
The updated presentation I gave at CF.Objective() 2010 is available here: [link] At the end of the preso I gave a brief, pre-recorded demo of wri ...

Posted By Brad Munz:
I've come across a OOM problem in HotSpot which looks alot like this: java.lang.OutOfMemoryError: requested 4096000 bytes for GrET in /BUILD_AREA/jdk6 ...

recently played

 

no song is playing

now playing, a plug-in for itunes

Categories

 
RSS Adobe (34)
RSS Bicycling (9)
RSS Blogging (39)
RSS Books (13)
RSS Breeze (13)
RSS CFMX Podcasts (10)
RSS ColdFusion (429)
RSS Computer Technology (51)
RSS Events (26)
RSS Flex (20)
RSS Gadgets (10)
RSS HiTech Industry (16)
RSS Java (25)
RSS Learning (57)
RSS Linux (70)
RSS Mac OS X (22)
RSS Macromedia (27)
RSS Meetup (35)
RSS New England (62)
RSS Odds & Ends (25)
RSS Outdoors (32)
RSS Personal (29)
RSS Photos (111)
RSS Photoshop (29)
RSS Podcasts (18)
RSS Rants (19)
RSS Restaurants (8)
RSS Science (34)
RSS Spain (16)
RSS Travel (42)
RSS Twitter (10)
RSS Video (20)
RSS Webcam (3)
RSS Writing (10)

Blogs I Read

 
Terrence Ryan
Ben Forta
Ray Camden
Kinky Solutions
Dan Vega
Gary Gilbert
Simeon Bateman
Red Hat Blogs
O'Reilly Digital Media
O'Reilly Radar
John Nack
The Strobist
Scott Kelby
Matt Kloskowski
Joe McNally
Digital Photography School
Engadget
Science Blog

RSS

 


Add to Google
Add to My Yahoo!

Aggregated By

 


Aggregated by ColdFusionBlogger.org

Credits and Stuff

 
BlogCFC - Free ColdFusion Powered Blog Software
CJM Group - ColdFusion Website Hosting


 
 
blog | photos | flickr | referers | webcam | stats | about | contact
 
Copyright © 2010 Steven Erat. All rights reserved.
This is a personal weblog. The opinions expressed here represent my own and not those of my employer