{"id":48700,"date":"2024-10-07T23:25:15","date_gmt":"2024-10-07T15:25:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/48700\/"},"modified":"2024-10-07T23:25:16","modified_gmt":"2024-10-07T15:25:16","slug":"iis-%e6%8c%87%e4%bb%a4%ef%bc%9aset-webapppoolstate-%e8%a8%ad%e7%bd%ae-web-%e6%87%89%e7%94%a8%e6%b1%a0%e7%8b%80%e6%85%8b","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/48700\/","title":{"rendered":"IIS \u6307\u4ee4\uff1aSet-WebAppPoolState &#8211; \u8a2d\u7f6e Web \u61c9\u7528\u6c60\u72c0\u614b"},"content":{"rendered":"<h1 id=\"iis-%e6%8c%87%e4%bb%a4%ef%bc%9aset-webapppoolstate-%e8%a8%ad%e7%bd%ae-web-%e6%87%89%e7%94%a8%e6%b1%a0%e7%8b%80%e6%85%8b-vdhVunHyel\">IIS \u6307\u4ee4\uff1aSet-WebAppPoolState &#8211; \u8a2d\u7f6e Web \u61c9\u7528\u6c60\u72c0\u614b<\/h1>\n<p>\u5728 Windows Server \u74b0\u5883\u4e2d\uff0cIIS\uff08Internet Information Services\uff09\u662f\u4e00\u500b\u5f37\u5927\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u5ee3\u6cdb\u7528\u65bc\u6258\u7ba1\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5f0f\u3002\u7ba1\u7406 IIS \u7684\u4e00\u500b\u91cd\u8981\u65b9\u9762\u662f\u61c9\u7528\u6c60\u7684\u7ba1\u7406\u3002\u61c9\u7528\u6c60\u662f IIS \u4e2d\u7684\u4e00\u500b\u95dc\u9375\u7d44\u4ef6\uff0c\u8ca0\u8cac\u9694\u96e2\u4e0d\u540c\u7684\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5f0f\uff0c\u4ee5\u63d0\u9ad8\u5b89\u5168\u6027\u548c\u7a69\u5b9a\u6027\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e IIS \u6307\u4ee4 <code>Set-WebAppPoolState<\/code>\uff0c\u4e26\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528\u6b64\u6307\u4ee4\u4f86\u8a2d\u7f6e Web \u61c9\u7528\u6c60\u7684\u72c0\u614b\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e6%87%89%e7%94%a8%e6%b1%a0%ef%bc%9f-vdhVunHyel\">\u4ec0\u9ebc\u662f\u61c9\u7528\u6c60\uff1f<\/h2>\n<p>\u61c9\u7528\u6c60\u662f\u4e00\u7d44\u4e00\u6216\u591a\u500b\u7db2\u7ad9\u7684\u96c6\u5408\uff0c\u9019\u4e9b\u7db2\u7ad9\u5171\u4eab\u76f8\u540c\u7684\u8a2d\u5b9a\u548c\u8cc7\u6e90\u3002\u6bcf\u500b\u61c9\u7528\u6c60\u90fd\u5728\u5176\u81ea\u5df1\u7684\u9032\u7a0b\u4e2d\u904b\u884c\uff0c\u9019\u610f\u5473\u8457\u5982\u679c\u4e00\u500b\u61c9\u7528\u6c60\u4e2d\u7684\u7db2\u7ad9\u51fa\u73fe\u554f\u984c\uff0c\u4e0d\u6703\u5f71\u97ff\u5230\u5176\u4ed6\u61c9\u7528\u6c60\u4e2d\u7684\u7db2\u7ad9\u3002\u9019\u7a2e\u9694\u96e2\u6027\u4f7f\u5f97\u61c9\u7528\u6c60\u6210\u70ba\u7ba1\u7406\u548c\u7dad\u8b77 IIS \u74b0\u5883\u7684\u91cd\u8981\u5de5\u5177\u3002<\/p>\n<h2 id=\"set-webapppoolstate-%e6%8c%87%e4%bb%a4%e6%a6%82%e8%bf%b0-vdhVunHyel\">Set-WebAppPoolState \u6307\u4ee4\u6982\u8ff0<\/h2>\n<p><code>Set-WebAppPoolState<\/code> \u662f\u4e00\u500b PowerShell \u6307\u4ee4\uff0c\u7528\u65bc\u555f\u52d5\u3001\u505c\u6b62\u6216\u91cd\u555f IIS \u61c9\u7528\u6c60\u3002\u9019\u500b\u6307\u4ee4\u7684\u57fa\u672c\u8a9e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code>Set-WebAppPoolState -Name &lt;AppPoolName&gt; -state &lt;State&gt;<\/code><\/pre>\n<p>\u5728\u9019\u88e1\uff0c<code>&lt;AppPoolName&gt;<\/code> \u662f\u60a8\u8981\u64cd\u4f5c\u7684\u61c9\u7528\u6c60\u7684\u540d\u7a31\uff0c\u800c <code>&lt;State&gt;<\/code> \u5247\u53ef\u4ee5\u662f\u4ee5\u4e0b\u4e09\u500b\u503c\u4e4b\u4e00\uff1a<\/p>\n<ul>\n<li><code>Started<\/code> &#8211; \u555f\u52d5\u61c9\u7528\u6c60<\/li>\n<li><code>Stopped<\/code> &#8211; \u505c\u6b62\u61c9\u7528\u6c60<\/li>\n<li><code>Recycle<\/code> &#8211; \u91cd\u555f\u61c9\u7528\u6c60<\/li>\n<\/ul>\n<h2 id=\"%e4%bd%bf%e7%94%a8%e7%af%84%e4%be%8b-vdhVunHyel\">\u4f7f\u7528\u7bc4\u4f8b<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f7f\u7528 <code>Set-WebAppPoolState<\/code> \u6307\u4ee4\u7684\u7bc4\u4f8b\uff1a<\/p>\n<h3 id=\"%e5%95%9f%e5%8b%95%e6%87%89%e7%94%a8%e6%b1%a0-vdhVunHyel\">\u555f\u52d5\u61c9\u7528\u6c60<\/h3>\n<pre><code>Set-WebAppPoolState -Name \"MyAppPool\" -State Started<\/code><\/pre>\n<h3 id=\"%e5%81%9c%e6%ad%a2%e6%87%89%e7%94%a8%e6%b1%a0-vdhVunHyel\">\u505c\u6b62\u61c9\u7528\u6c60<\/h3>\n<pre><code>Set-WebAppPoolState -Name \"MyAppPool\" -State Stopped<\/code><\/pre>\n<h3 id=\"%e9%87%8d%e5%95%9f%e6%87%89%e7%94%a8%e6%b1%a0-vdhVunHyel\">\u91cd\u555f\u61c9\u7528\u6c60<\/h3>\n<pre><code>Set-WebAppPoolState -Name \"MyAppPool\" -State Recycle<\/code><\/pre>\n<p>\u9019\u4e9b\u6307\u4ee4\u53ef\u4ee5\u5e6b\u52a9\u7cfb\u7d71\u7ba1\u7406\u54e1\u5feb\u901f\u6709\u6548\u5730\u7ba1\u7406\u61c9\u7528\u6c60\u7684\u72c0\u614b\uff0c\u78ba\u4fdd\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5f0f\u7684\u7a69\u5b9a\u904b\u884c\u3002<\/p>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-vdhVunHyel\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<p>\u5728\u4f7f\u7528 <code>Set-WebAppPoolState<\/code> \u6307\u4ee4\u6642\uff0c\u6709\u5e7e\u9ede\u9700\u8981\u6ce8\u610f\uff1a<\/p>\n<ul>\n<li>\u78ba\u4fdd\u60a8\u64c1\u6709\u8db3\u5920\u7684\u6b0a\u9650\u4f86\u57f7\u884c\u9019\u4e9b\u64cd\u4f5c\uff0c\u901a\u5e38\u9700\u8981\u4ee5\u7ba1\u7406\u54e1\u8eab\u4efd\u904b\u884c PowerShell\u3002<\/li>\n<li>\u5728\u505c\u6b62\u6216\u91cd\u555f\u61c9\u7528\u6c60\u4e4b\u524d\uff0c\u5efa\u8b70\u5148\u6aa2\u67e5\u61c9\u7528\u6c60\u4e2d\u7684\u7db2\u7ad9\u662f\u5426\u6b63\u5728\u904b\u884c\uff0c\u4ee5\u907f\u514d\u4e2d\u65b7\u670d\u52d9\u3002<\/li>\n<li>\u4f7f\u7528 <code>Get-WebAppPoolState<\/code> \u6307\u4ee4\u53ef\u4ee5\u67e5\u770b\u61c9\u7528\u6c60\u7684\u7576\u524d\u72c0\u614b\uff0c\u9019\u6709\u52a9\u65bc\u5728\u9032\u884c\u66f4\u6539\u4e4b\u524d\u9032\u884c\u78ba\u8a8d\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-vdhVunHyel\">\u7e3d\u7d50<\/h2>\n<p>\u900f\u904e\u4f7f\u7528 <code>Set-WebAppPoolState<\/code> \u6307\u4ee4\uff0c\u7cfb\u7d71\u7ba1\u7406\u54e1\u53ef\u4ee5\u6709\u6548\u5730\u7ba1\u7406 IIS \u61c9\u7528\u6c60\u7684\u72c0\u614b\uff0c\u5f9e\u800c\u63d0\u9ad8\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5f0f\u7684\u7a69\u5b9a\u6027\u548c\u5b89\u5168\u6027\u3002\u7121\u8ad6\u662f\u555f\u52d5\u3001\u505c\u6b62\u9084\u662f\u91cd\u555f\u61c9\u7528\u6c60\uff0c\u9019\u500b\u6307\u4ee4\u90fd\u63d0\u4f9b\u4e86\u4e00\u500b\u7c21\u55ae\u800c\u6709\u6548\u7684\u89e3\u6c7a\u65b9\u6848\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u80fd\u548c\u7a69\u5b9a\u6027\u7684\u74b0\u5883\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u65b9\u6848\u5c07\u662f\u660e\u667a\u7684\u9078\u64c7\uff0c\u56e0\u70ba\u5b83\u80fd\u5920\u63d0\u4f9b\u9748\u6d3b\u7684\u8cc7\u6e90\u914d\u7f6e\u548c\u512a\u8cea\u7684\u670d\u52d9\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 IIS \u6307\u4ee4 Set-WebAppPoolState \u4f86\u8a2d\u7f6e Web \u61c9\u7528\u6c60\u7684\u72c0\u614b\uff0c\u8f15\u9b06\u7ba1\u7406\u61c9\u7528\u7a0b\u5e8f\u7684\u904b\u884c\u548c\u6027\u80fd\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-48700","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=48700"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48700\/revisions"}],"predecessor-version":[{"id":48701,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48700\/revisions\/48701"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=48700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=48700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=48700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}