{"id":425,"date":"2026-10-14T07:41:36","date_gmt":"2026-10-14T07:41:36","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2015\/08\/21\/bootstrap-a-microsoft-windows-node-using-chef\/"},"modified":"2026-10-14T07:41:36","modified_gmt":"2026-10-14T07:41:36","slug":"bootstrap-a-microsoft-windows-node-using-chef","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/bootstrap-a-microsoft-windows-node-using-chef\/","title":{"rendered":"Bootstrap a Windows Node with Chef over WinRM (Knife Windows Guide)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Bootstrapping a Windows node with Chef over WinRM installs Chef Infra Client on the target host, registers it with Chef Server, and applies an initial run list. This revised guide is for DevOps engineers who want a clean, repeatable baseline command and a safer way to operate it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Originally published on 2015-08-21; fully revised and updated.<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2015\/08\/bootstrap-a-microsoft-windo.png\"><img decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2015\/08\/bootstrap-a-microsoft-windo.png\" alt=\"Original screenshot for bootstrapping a Windows node with Chef\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The original note emphasized that the <strong>knife windows<\/strong> plugin is required and used <code>knife bootstrap windows winrm<\/code> to onboard a node. References preserved from the original post: <a href=\"https:\/\/www.devopsschool.com\/blog\/bootstrap-a-microsoft-windows-node-using-chef\/\">original permalink<\/a> and <a href=\"http:\/\/docs.chef.io\/plugin_knife_windows.html\">knife windows plugin documentation link<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites for Windows bootstrap over WinRM<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>A workstation with Chef and <code>knife<\/code> configured to reach your Chef Server.<\/li><li>The Windows target host reachable over WinRM.<\/li><li>A WinRM-capable account (the original example used <code>administrator<\/code>).<\/li><li>A planned Chef node name and initial run list (for example, <code>recipe[snc_firefox]<\/code>).<\/li><li>The <code>knife windows<\/code> plugin available on the workstation, as called out in the source post.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Bootstrap workflow<\/h2>\n\n\n\n<pre class=\"mermaid\">\nflowchart TD\n    A[Collect host, credentials, and run list] --> B[Confirm WinRM access]\n    B --> C[Run knife bootstrap windows winrm]\n    C --> D[Install Chef Infra Client on Windows node]\n    D --> E[Register node and client in Chef Server]\n    E --> F[Apply initial run list]\n    F --> G[Verify node registration]\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Command variants from the original post<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The source contained both a long-option and short-option style command. The password has been intentionally replaced with a placeholder, and the obvious typo <code>nife<\/code> has been corrected to <code>knife<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Style<\/th><th>Example options<\/th><th>Best for<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>Long options<\/td><td><code>--winrm-user<\/code> <code>--winrm-password<\/code><\/td><td>Readable scripts and handoffs<\/td><td>Most explicit and easiest to review.<\/td><\/tr><tr><td>Short options<\/td><td><code>-x<\/code> <code>-P<\/code><\/td><td>Fast interactive usage<\/td><td>Aliases can differ by knife version; verify with local help output.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Long-form command example<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\">knife bootstrap windows winrm windows-host.example.com \\\n  --winrm-user Administrator \\\n  --winrm-password <span class=\"hljs-string\">\"$WINRM_PASSWORD\"<\/span> \\\n  --node-name firefox_win \\\n  --run-<span class=\"hljs-keyword\">list<\/span> <span class=\"hljs-string\">'recipe&#91;snc_firefox]'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Short-form command example<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\">knife bootstrap windows winrm windows-host.example.com \\\n  -x Administrator \\\n  -P <span class=\"hljs-string\">\"$WINRM_PASSWORD\"<\/span> \\\n  --node-name firefox_win \\\n  --run-<span class=\"hljs-keyword\">list<\/span> <span class=\"hljs-string\">'recipe&#91;snc_firefox]'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Post-bootstrap validation commands<\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\">knife node show firefox_win\nknife client show firefox_win\nknife node <span class=\"hljs-keyword\">list<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Storing WinRM passwords directly in shell history instead of using environment variables or a secret manager.<\/li><li>WinRM connectivity failures caused by network path, host resolution, or endpoint configuration issues.<\/li><li>Using an incorrect run list or recipe name during first converge.<\/li><li>Assuming short flags always map the same way across knife versions.<\/li><li>Simple command typos (for example, <code>nife<\/code> instead of <code>knife<\/code>).<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Prefer long-form flags in automation for clarity and auditability.<\/li><li>Inject credentials at runtime (for example, environment variables) rather than hardcoding.<\/li><li>Run <code>knife bootstrap windows winrm --help<\/code> on your workstation to confirm exact option behavior for your installed version.<\/li><li>Validate node and client objects immediately after bootstrap to catch registration issues early.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to bootstrap a Microsoft Windows node using Chef with the `knife bootstrap windows winrm` workflow. This revised guide adds prerequisites, command variants, validation steps, and operational pitfalls.<\/p>\n","protected":false},"author":1,"featured_media":3392,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[55],"tags":[568,1545,1546,407,148,1543,1544,182,1547],"class_list":["post-425","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows","tag-bootstrap","tag-bootstrap-microsoft-windows-node","tag-bootstrap-node","tag-chef","tag-microsoft","tag-node","tag-node-using-chef","tag-windows","tag-windows-server-node"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=425"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/425\/revisions"}],"predecessor-version":[{"id":79298,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/425\/revisions\/79298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3392"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}