English 中文(简体)
如何在使用指挥线的遥远机器上回收一台备用机
原标题:How to recycle an app pool on a remote machine using the command line

我的卷宗中有以下内容:我试图从指挥线上运行:

strServerName = "ServerName"
strAppPoolName = "DefaultAppPool"
set objAppPools = GetObject("IIS://" & strServerName 
                                  & "/w3svc/AppPools/" & strAppPoolName & "")
objAppPools.Recycle()

然而,当我从碎条线开起手时,就会出现以下错误:

微软 VB文本操作时间错误: 活跃 X部分可制造物体:目标

我正在当地机器上运行XP,遥控机器有7个IIS。

我如何能够做到这一点?

问题回答

利用权力指挥管理。 例:

Invoke-WMIMethod Recycle -Path "IIsApplicationPool.Name= W3SVC/APPPOOLS/apppoolname " -Computer "WIN-Computername" -Namespace rootMicrosoftIISv2 -Authentication PacketPrivacy

apprixname 是您的申请集合名称。

WIN-Computername 是您的远程/当地服务器名称。

利用权力在服务器上遥控执行:

Invoke-Command -ComputerName <YOUR_IIS_SERVER_NAME> -ScriptBlock { Restart-WebAppPool -Name <YOUR_APP_POOL_NAME> }

我刚刚从Windows XP机器到Windows 2008R2机器进行了审判。 它发挥了作用。 因此,你肯定走上正轨。

如果你寻求另一种方式,就会从指挥中迅速尝试。 至少当错误信息不奏效时,它就更具体。

wmic /namespace:"\rootMicrosoftIISv2" /node:"**serverName**" path IISApplicationPool where (name like  %**DefaultAppPool**% ) call recycle

在指挥下,我在尝试一切事情之后工作!

c %windir%system32inetsrv

传真:”

备注1.com

显然,在此之前,你将管理一些sh的遥控指挥。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签