{"id":746,"date":"2016-05-09T22:05:47","date_gmt":"2016-05-09T20:05:47","guid":{"rendered":"http:\/\/www.rolig.dk\/?p=746"},"modified":"2016-05-09T22:05:47","modified_gmt":"2016-05-09T20:05:47","slug":"clean-up-before-sysprep","status":"publish","type":"post","link":"https:\/\/rolig.dk\/?p=746","title":{"rendered":"Clean Up before Sysprep"},"content":{"rendered":"<p>I use MDT to build the image I deploy with SCCM. When the image have been patched, there is a lot of superseded patches and temp files. With this script \u201c<a href=\"https:\/\/onedrive.live.com\/redir?resid=447ADB7F2AA023F5!10915&amp;authkey=!ABTLDiQQfNwEfnA&amp;ithint=folder%2cps1\" target=\"_blank\" rel=\"noopener noreferrer\">Action-CleanupBeforeSysprep-2_4.wsf<\/a>\u201d you can remove a lot of the files that are not needed anymore. It is about 1 GB you can compress the image. For Windows 8 + Windows 8.1 + Windows 10, you can skip step 2 to 6. Thanks to <a href=\"https:\/\/deploymentbunny.com\/2014\/06\/05\/nice-to-know-get-rid-of-all-junk-before-sysprep-and-capture-when-creating-a-reference-image-in-mdt\/\" target=\"_blank\" rel=\"noopener noreferrer\">Mikael Nystrom blog post<\/a> for the inspiration.<\/p>\n<p>1. Download \u201c<a href=\"https:\/\/onedrive.live.com\/redir?resid=447ADB7F2AA023F5!10915&amp;authkey=!ABTLDiQQfNwEfnA&amp;ithint=folder%2cps1\" target=\"_blank\" rel=\"noopener noreferrer\">Action-CleanupBeforeSysprep-2_4.wsf<\/a>\u201d and create an application in MDT<br \/><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-39.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-39.png\" width=\"600\" height=\"496\"><\/a><\/p>\n<p><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-40.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-40.png\" width=\"600\" height=\"496\"><\/a><\/p>\n<p><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-41.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-41.png\" width=\"600\" height=\"499\"><\/a><\/p>\n<p>2. For windows 7 and Server 2008, download \u201c<a href=\"https:\/\/support.microsoft.com\/da-dk\/kb\/2852386\" target=\"_blank\" rel=\"noopener noreferrer\">KB2852386<\/a>\u201d<\/p>\n<p>3. Go to DeploymentShare \u2013&gt; Packages and create a folder called \u201cWindows 7 x64\u201d<br \/><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-42.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-42.png\" width=\"311\" height=\"302\"><\/a><\/p>\n<p>4. Right click \u201cWindows 7 x64\u201d and choose \u201cImport OS Packages\u201d. Browse to the file that you downloaded in step 2 and complete the wizard.<\/p>\n<p>5. Go to: DeploymentShare \u2013&gt; Advanced Configuration \u2013&gt; Selection Profiles. Right click choose \u201cNew Selection Profile\u201d<br \/><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-43.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-43.png\" width=\"441\" height=\"462\"><\/a><\/p>\n<p><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-44.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-44.png\" width=\"600\" height=\"498\"><\/a><\/p>\n<p><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-45.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-45.png\" width=\"600\" height=\"498\"><\/a><\/p>\n<p><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-46.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-46.png\" width=\"600\" height=\"496\"><\/a><\/p>\n<p>6. Edit your task sequence and make sure the you have selected \u201cAll Packages\u201d or \u201cWindows 7 x64\u201d in this step: Preinstall \u2013&gt; Apply Patches \u2013&gt; Selection profile<br \/><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-47.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-47.png\" width=\"600\" height=\"404\"><\/a>&nbsp;<\/p>\n<p>7. Create The follow groups and steps in your task sequence<br \/><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-48.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-48.png\" width=\"496\" height=\"217\"><\/a><\/p>\n<p><a href=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image-49.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/rolig.dk\/wp-content\/uploads\/2016\/05\/image_thumb-49.png\" width=\"426\" height=\"414\"><\/a><\/p>\n<p>That\u2019s it. You have now created a smaller wim file.<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Frolig.dk%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F746&amp;text=Hey%20check%20this%20out\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/rolig.dk\/wp-content\/plugins\/social-media-feather\/synved-social\/addons\/extra-icons\/image\/social\/circle\/96x96\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Frolig.dk%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fposts%252F746&amp;title=Clean%20Up%20before%20Sysprep\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/rolig.dk\/wp-content\/plugins\/social-media-feather\/synved-social\/addons\/extra-icons\/image\/social\/circle\/96x96\/linkedin.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>I use MDT to build the image I deploy with SCCM. When the image have been patched, there is a lot of superseded patches and temp files. With this script \u201cAction-CleanupBeforeSysprep-2_4.wsf\u201d you can remove a lot of the files that are not needed anymore. It is about 1 GB you can compress the image. For [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[17],"class_list":["post-746","post","type-post","status-publish","format-standard","hentry","category-sccm","tag-mdtsysprepsccmosdimage"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rolig.dk\/index.php?rest_route=\/wp\/v2\/posts\/746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rolig.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rolig.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rolig.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rolig.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=746"}],"version-history":[{"count":0,"href":"https:\/\/rolig.dk\/index.php?rest_route=\/wp\/v2\/posts\/746\/revisions"}],"wp:attachment":[{"href":"https:\/\/rolig.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rolig.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rolig.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}