远程更改 IIS6 网站目录

发布于 2024-07-13 14:58:07 字数 449 浏览 5 评论 0原文

首先,之前的情况:我们这个项目有一个一键构建脚本。 它由 TFS Deployer + PowerShell + VB 脚本拼凑在一起。 TFS Deployer 位于生产计算机上,将新网站文件复制到全新目录中,然后调用 VB 脚本将 IIS 网站更改为新目录。

现在,我正在让团队远离 TFS/MSBuild 的恐怖。 我在专用构建服务器上有一个 TeamCity 构建代理。 一个简单的 NANT 脚本通过共享文件夹将构建工件从构建服务器部署到生产服务器。 简单、快速、有效。

但是,我还没有找到一种方法:a) 远程运行 VB 脚本 b) 使用不同的机制远程更新 IIS 站点(在一键构建中以编程方式)。 Windows Server 2003/IIS6。 有任何想法吗?

更新:我通过创建另一个 vbs 来解决这个问题,该 vbs 远程调用我通过 WMI 拥有的旧 vbs。 感谢大家!

First, the prior situation: We have this project with a one-click build script. It's cobbled together with TFS Deployer + PowerShell + VB Script. TFS Deployer sits on the production machine, copies the new website files into a brand new directory, and then calls a VB Script that changes the IIS website to the new directory.

Now, I'm moving the team away from the horror that is TFS/MSBuild. I have a TeamCity build agent on a dedicated build server. A simple NANT script deploys the build artifacts from the build server to the production server through a shared folder. Simple, quick, and effective.

However, I haven't found either a way a) to run the VB Script remotely b) update the IIS site remotely with a different mechanisms (programmatically within the 1-click build). Windows Server 2003/IIS6. Any ideas?

Update: I solved this by creating another vbs that remotely called the old vbs I had through WMI. Thanks everyone!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

帅气尐潴 2024-07-20 14:58:07

如果我要朝任何方向发展,我会考虑设置一个 WMI 脚本来完成这项工作,然后在相关服务器上配置它。 我必须考虑如何轻松地将其包含到您的自动化构建中。 我个人还没有使用过 TeamCity,尽管我参加过有关 TeamCity 如何工作的会议。

WMI 也可以运行该脚本,并充当某种服务前端,因此您可以重用您已经投入精力的内容。

If I were to head in any direction, I would consider setting up a WMI script to do the work and then configuring it on the server in question. I would have to think about how to easily include this into your automated build. I personaally have not worked with TeamCity yet, although I have attended sessions on how it works.

WMI might be able to run the script, as well, and act as a sort of service front end, so you may be able to reuse what you have already spent effort on.

我一向站在原地 2024-07-20 14:58:07

您能否将同一服务器上不同网站的 vbscript 文件更改为 ASP 文件? 这将允许您远程调用它。

Could you change the vbscript file into an ASP file in a different website on the same server? This would allow you to call it remotely.

花想c 2024-07-20 14:58:07

我们使用了 NAntContrib 的 mkiisdir 任务在远程计算机上创建/修改虚拟目录。

<mkiisdir iisserver="Staging" dirpath="c:\temp" vdirname="Temp" />

这应该创建(如果 vdir 不存在)或更改位置(如果 vdir 已存在)。

一般来说,最干净的方法似乎是首先使用 deliisdir 任务,然后是创建。

<deliisdir vdirname="Temp" failonerror="false" />
<mkiisdir dirpath="c:\temp" vdirname="Temp" accessread="true" accesswrite="false" accessscript="true" enabledirbrowsing="false" authntlm="true" authbasic="false" authanonymous="false" appcreate="Pooled" />

快乐编码!

We've used NAntContrib's mkiisdir task to create/modify a virtual directory on remote machines.

<mkiisdir iisserver="Staging" dirpath="c:\temp" vdirname="Temp" />

This should either create (if the vdir doesn't exist) or change the location (if the vdir already exists).

Generally, it seems the cleanest way to do this is to first delete the vdir with the deliisdir task, followed by a create.

<deliisdir vdirname="Temp" failonerror="false" />
<mkiisdir dirpath="c:\temp" vdirname="Temp" accessread="true" accesswrite="false" accessscript="true" enabledirbrowsing="false" authntlm="true" authbasic="false" authanonymous="false" appcreate="Pooled" />

Happy coding!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文