Does anyone know what the port used to run the task scheduler is in Windows?
Does the task scheduler have a port? May I know what the port is, or how to look for the port that the server using to run the task scheduler is?
I know that this is an older question, but maybe this will help. If I correctly understand what you're asking, you can use Task Scheduler itself or use schtasks.exe from the command prompt to manage tasks on a remote computer. I can't find a source, but can tell you that you will need port 135 open in order for this to work.
Windows doesn't expose task scheduler APIs over the network, so there's no port. If you wanted to control the task scheduler remotely, you would need to expose it to the network yourself, by writing a small server process to expose the scheduler API (inasmuch as it's available from the userspace - most of it is available only from the kernel space, i.e. from drivers).
Your idea isn't as outlandish as it may seem, though. There are operating systems where even the most basic subsystems communicate using messages sent over abstract communication ports. Minix 3, for example, by default runs the scheduler embedded in the kernel process. But the scheduler certainly can be run as a separate, communicating process in the user space. This user-mode implementation of process scheduling in Minix 3 does what you think of (almost): it is a process scheduler that runs as a separate process ("server"), and the rest of the system only communicates with it via messages. This message interface to the scheduler process (or any process, in fact), can be easily exposed over a network interface - this was done for Minix by adding a NET server to implement remote process communication.
It uses port 445 for Windows Server 2012 and later;
135/139 for the older ones.
See https://cyberark-customers.force.com/s/article/Required-Ports-for-Windows-Scheduled-Tasks-Windows-Server-2012
For Windows Server 2012 / 2012 R2 or any modern system, only port 445 is needed as it should support SMB over TCP. Port 139 is needed for older systems as it uses NETBIOS over TCP instead to transmit SMB communication from one system to another.
There is no port, nor a server. Task scheduler is just a way of scheduling things to run.
Its ran entirely on the local machine, with no net communication.
Related
I am Unix java developer trying to help a datastage developer, so out of my aquarium.
The datastage process connects to a database hosting financial transactions on a unix server. there is a datastage process for migrating financial transactions to the ACCOUNTING system. The ETL developers for one reason or another have specified they cannot run one or more specific ETL while in-taking new financial transactions and have specified the process that inserts transactions into the DB be stopped.
me java geek thinks have some process checking a service running at port 55555 would be perfect. But we cannot find a way for datastage to create a socket connection to a port to check. I don't do datastage so I don't know how to work around it's limitations.
The ETL developer thinks a cron script running every minute that inserts an up/down status for the process into a special table would be perfect. I think it is a waste of cpu.
I cannot be the only company that cannot run an ETL when some process is running on a remote system.
How did you solve this issue? Is there a way to connect to a remote servers socket and run the service from datastage???
thanks
after a bunch of discussion.
options we found
Add a step to the start stop server scripts that writes process status to a table. pro: easy to implement. con: not turely accurate (some geek like me is likely to bypass the start/stop script and run only build/run the executable bypassing the start stop script and bypassing the step that inserts the status.) No network and InfoSec paperwork
Cron based script that updates the table with the status on a minute by minute basis. what a pain!!!! No network and InfoSec paperwork.
A script made available to the network through inet or xinet. Problem is datastage ETL developer does not know how to connect to a socket via C or java program. Creates Infosec and network paperwork issues.
New web service (there is a tomcat server serving up a number of web services) Problem is datastage ETL developer does not know how to connect to a socket via C or java program. Creates Infosec and network paperwork issues.
options 3 and 4 are accurate and realtime. options 1 and 2 opens up the possibility of inaccuracies by bypassing process, but that opens up a different can of worms.
We are probably going to implement option 1
I am going to write a service to manipulate a database that all Insert/Update/Delete/Select will be executed via this service.
However, I only know socket services (Web service is a kind of socket service because it uses network layer).
What I am concerning is the performance of socket services. Because they needs to go through the network layer. So OS needs to start the network layer and then pass all packets to my program that maybe have performance overhead on network layer.
So my question is: is there any non-socket services working in both Windows and Linux?
Updated at 19th January 2012
I found the solution here: http://en.wikipedia.org/wiki/Inter-process_communication
Is this over the network, or on same box?
If over the network, sockets are fine, WCF, web services are all fine (this is how SQL Server, Oracle and everything else work...)
If local, same box, you can use a shared memory approach, and avoid the network completely.
FWIW, Shared Memory totally works on Windows. See CreateSharedMemory function from Win32-SDK. In .NET, you can use .NET remoting with shared memory as the transport. There are many ways to do this on Windows.
I'm using Win32 Service object and there's Change which could be used to set Dependencies. Is it possible to set the service to depend on services running on a different machine? Currently, all the services run on the same machine but it's possible to run them each on a separate machine.
Nothing like that exists today, AFAIK. It is a good ask. Check this MS connect item: http://connect.microsoft.com/WindowsServerFeedback/feedback/details/293384/remote-machine-service-dependency
That said, you can create a script or another service to poll remote machines for dependent service startup and then start the local service.
I am writing a script that powers on a system via network. And then i need to run a few commands on the other host. How do I know whether the system has powered on?
My programming language is Perl and the target host is RHEL5.
Is there any kernel interrupt or network boot information that indicates the system has powered on and the os has loaded?
[In a different scenario] I was also wondering just in case if i just switch on my Machine manually. when is it exactly said to have powered on. and when is the OS is supposed to have booted completely for a network related operation such as executing a network command there. What if the system is on DHCP how would a remote system then search for this machine [i guess it is possible via mac address. but if i am wrong ].
If I have missed out any info please feel free to ask me. If you have any suggestions to make the task easier please surface them :)
thanx
imkin
Well, I'd say the system is booted when it can perform the request you've made of it. That is, the sshd daemon is running. That's booted sufficiently for your purposes (I assume - substitute for whatever daemon you really need).
So, I'd send the power-on signal, and check back every 15-30 seconds to see if I could connect. If I've failed to connect within whatever is a reasonable time for that machine (2 minutes or 5 minutes or whatever), then I'd send an alert to the IT support team. Well, I'd send it to myself first, and only once I've investigated a few failures or so and found them to all be legitimate would I start sending it directly to IT.
DHCP is kind of a different question. You'd have to start learning about broadcasting, or having a daemon on that machine "call home" during boot to register its current IP address. And it would have to "call home" every time a DHCP renewal changed its IP address. This is decidedly more convoluted. Try to avoid DHCP on such server machines if at all possible.
On the rebooting machine you can install a script in your crontab with the special #reboot assertion (see man 5 crontab). That script could send a notification of some kind to the other machine, notifying it that it's up now.
I think checking for sshd sounds like a good approach.
As for the DHCP problem: if the other computer is on the same subnet you can look it up by MAC address using Net::ARP.
How about adding a script to the remote machine which gets run on startup to have it tell you when it is ready.
What is the best way to access a running mono application via the command line (Linux/Unix)?
Example: a mono server application is running and I want to send commands to it using the command line in the lightest/fastest way possible, causing the server to send back a response (e.g. to stdout).
I would say make a small, simple controller program that takes in your required command line arguments and uses remoting to send the messages to the running daemon.
This would be similar to the tray icon controller program talking to the background service that is prevalent in most Windows service patterns.
Mono's gsharp tool is a graphical REPL that lets you Attach to Process.
#Rich B: This is definately a suitable solution, which I already had implemented - however on the server I have to use, the remoting approach takes around 350ms for a single request.
I've measured the time on the server side of the request handling - the request is handled in less than 10ms, so it has to be the starting of the client program and the tcp connection, that takes up the time.
Hence the hope that I can find another way to post the requests to the server application.
You can use the system.net.sockets abstractions to create a service on a TCP port, and then telnet to that port.
Check the library status page; Mono's coverage here is a bit patchy.