Here is a little script whipped up just for you.. (although I'm positive there is a UDF somewhere that basically does this):
code:
break on
$cpname = "server"
$domain = "domain"
$service = "IISADMIN"
$objcomp = GetObject("WinNT://$domain/$cpname,Computer")
IF @error = 0 ;computer exists
$obj=GetObject("WinNT://$domain/$cpname/$service,Service")
If @error = 0
$service + " exists on the target PC." ?
$scode = "unknown","stopped","start pending","stop pending","running","continue pending","pause pending","paused","error","unknown"
$Status = $obj.status
$Service+ " " + $scode[$status] + "."
Else
$Service + " does not exist on the target PC." ?
Endif
Else
"Computer does not exist or is not available."
Endif
You can get by with crossing into another domain to see if IISADMIN is installed as long as your administrator passwords match. However, you may have trouble finding out the status of the service unless you can authenticate properly on the domain in question. Essentially, this works best if you only run from the domain you're checking.
Brian