简体   繁体   中英

how to start/stop an application pool in IIS 6.0 from Java remotely

Can I start and stop IIS 6.0 application pools on one machine from within Java code running on another machine? If so, how?

Use Java's facility to execute another program and use the command line tool such as

appcmd stop apppool /apppool.nam
appcmd start apppool /apppool.nam

(see http://technet.microsoft.com/en-us/library/cc732742(WS.10).aspx )

I believe you can do it using WMI. Please take a look http://msdn.microsoft.com/en-us/library/ms525309(v=vs.90).aspx

and here: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/9041b0a5-c314-46d9-8f56-01506687f357.mspx?mfr=true

Or just google "iis wmi".

First find API you need and find a way to write JScript or VBScript that does what you need.

Then you have 2 ways.

  1. Just execute script you have just done from java using Runtime.exec()
  2. Use one of interoparability packages like JaWin, JIntegra or JInterop (or, probably others) to call the same code from java.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM