I have a Windows service application.
Currently all admin tasks are done through config editing.
I want to add some sort of command line interfaces – and i want it to do through powershell.
And i don’t know where should i start – how can i create application interface in this case. How powershell should communicate with service? remote feature also required in this case.
(In the feature there are maybe other admin tools – with GUI or through browser.)
Expanding a little on L.B’s short-ish remark: having a privileged service interact with the user’s desktop is not the best of ideas, because doing so may open a route for privilege elevation. Shatter attacks for instance worked that way.
A better way to handle interaction with the user would be to have an unprivileged listener on localhost (e.g.
127.0.0.1:5555) that will display messages submitted via that port, and have the privileged service connect to the listener to send messages to the user.The code snippet below – while leaving a lot room for improvement – should give you a general idea of how such a listener could look like: