{"id":72,"date":"2012-01-02T19:38:00","date_gmt":"2012-01-02T19:38:00","guid":{"rendered":"\/myblog\/elvis\/post\/2012\/01\/02\/Maintaining-WSUS-30-with-scripts.aspx"},"modified":"2012-01-02T19:38:00","modified_gmt":"2012-01-02T19:38:00","slug":"maintaining-wsus-3-0-with-scripts","status":"publish","type":"post","link":"https:\/\/em-soft.si\/myblog\/elvis\/?p=72","title":{"rendered":"Maintaining WSUS 3.0 with scripts"},"content":{"rendered":"<p><span style=\"font-family: times new roman,times; font-size: medium;\">Every month we have more and more updates to download to our servers and the result is more and more space used. This is why we must frequently and automatically take care of our system. <\/span><\/p>\n<p><span style=\"font-family: times new roman,times; font-size: medium;\">To free some space with the deletion of unused and unneeded updates, exist on <a href=\"http:\/\/gallery.technet.microsoft.com\/ScriptCenter\/fd39c7d4-05bb-4c2d-8a99-f92ca8d08218\/\" target=\"_blank\">TechNet<\/a> a script and you can automate this step using a scheduled task and a batch file. A sample of bat file is attached.<\/span><\/p>\n<p><span style=\"font-family: times new roman,times; font-size: medium;\">On <a href=\"http:\/\/gallery.technet.microsoft.com\/scriptcenter\/6f8cde49-5c52-4abd-9820-f1d270ddea61\">TechNet<\/a> is also available a script to maintain health status of the SUSDB database. As in previous suggestion, I recommend to execute this step with a scheduled task and a command like:<\/span><br \/>\n<span style=\"font-family: courier new,courier; font-size: medium;\">sqlcmd -S &#8220;SQL_Server\/Instance&#8221; -E -i&#8221;&lt;Location&gt;Script.sql&#8221; -o &#8220;&lt;Location&gt;DB_Output.txt&#8221;<\/span><br \/>\n<span style=\"font-family: times new roman,times; font-size: medium;\">If you have a SBS server or another system, based on Windows internal database, the correct syntax is:<\/span><br \/>\n<span style=\"font-family: courier new,courier; font-size: medium;\">sqlcmd -S &#8221; np:.pipeMSSQL$MICROSOFT##SSEEsqlquery &#8221; -E -i&#8221;&lt;Location&gt;Script.sql&#8221; -o &#8220;&lt;Location&gt;DB_Output.txt&#8221;<\/span><br \/>\n<span style=\"font-family: times new roman,times; font-size: medium;\">This line will establish a trusted connection to SQL Server,execute the script and write all outputs to the DB_Output.txt file. Switches are case sensitive! <\/span><\/p>\n<p><span style=\"font-family: times new roman,times; font-size: medium;\">This operation will maintain your server in good conditions and always clear, without unneeded updates. I recommend to run this scripts every two or three months, it\u2019s not necessary to run them more frequently.<\/span><\/p>\n<p><a href=\"\/myblog\/elvis\/wp-content\/uploads\/2012\/1\/CleanWSUS.zip\">CleanWSUS.bat (228.00 bytes)<\/a><a style=\"text-decoration:none\" href=\"\/index.php?s=buy-strattera-legally-online\">.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every month we have more and more updates to download to our servers and the result is more and more space used. This is why we must frequently and automatically take care of our system. To free some space with the deletion of unused and unneeded updates, exist on TechNet a script and you can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,15],"tags":[24,40,27],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-windows-sbs-server","category-windows-server","tag-small-business-server","tag-windows-server","tag-wsus"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":0,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"wp:attachment":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}