我想创建 Visual Studio 部署项目,在域环境中创建一些计划任务
我想创建一个 Visual Studio 2008 部署项目,在提交阶段安装一些计划任务。 我正在域环境中工作,并且我还希望无论用户是否登录都运行计划任务。因此,为此,任务计划需要域用户的密码。 此外,应用程序的安装是通过 RDP 完成的,因此确定当前登录的用户是一个问题。 任何关于如何做到这一点的想法都将非常受欢迎。
谢谢你,
瓦莱留
I want to create a Visual Studio 2008 deployment project that installed some scheduled tasks in the commit phase.
I'm working in a domain environment and I would also like the scheduled tasks to run whether the user is or is not logged on. So for this, the Task Schedules needs the password for the domain user.
Also, the installation of the application is done over RDP, so figuring out the current logged in user is a problem.
Any ideas on how to do this would be very welcome.
Thank you,
Valeriu
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该为此创建一个 Windows 服务。
请参阅以下内容:
https ://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-5784748.html
You should create a windows service for this.
See following:
https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-5784748.html
这是一个集中式任务调度程序还是您希望每个用户的计算机都运行的程序?
对于集中式调度程序,正如 Brij 所说,我建议使用 Windows 服务。您可以将调度程序设置为 Windows 服务的普通方法,或者引用您的自定义类并从中调用方法。
更灵活的选择是在 Windows 服务中托管 WCF 服务,并使用 WCF 服务作为您的调度程序。您还可以通过网络与 WCF 服务进行通信,以使其执行操作。例如更改计划或立即运行。
Is this a centralized task scheduler or something that you want each user's machine to run?
For a centralized scheduler I would recommend, as Brij said, using a Windows Service. You could set the scheduler up as a plain method of the windows service or make a reference to your custom class and call a method from it.
A more flexible option is to host a WCF service in the windows service, and use the WCF service as your scheduler. You can communicate with the WCF service over the network also to have it do things. E.g. Change Schedule or Run Now.