{"id":34,"date":"2008-07-30T22:53:39","date_gmt":"2008-07-30T13:53:39","guid":{"rendered":"http:\/\/www.jhouseconsulting.com\/index.php\/jhouseconsulting\/2008\/07\/30\/script-to-replace-delprofexe\/"},"modified":"2008-10-05T22:18:54","modified_gmt":"2008-10-05T13:18:54","slug":"script-to-replace-delprofexe","status":"publish","type":"post","link":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/2008\/07\/30\/script-to-replace-delprofexe-34","title":{"rendered":"Script to replace Delprof.exe"},"content":{"rendered":"<p><a target=\"_blank\" href=\"http:\/\/www.theshonkproject.com\/\">Joe Shonk<\/a> has written a very nice <a target=\"_blank\" href=\"http:\/\/www.theshonkproject.com\/index.php?option=com_content&amp;task=view&amp;id=50&amp;Itemid=1\">Delete Profiles Script<\/a> to replace the lack of flexibility found in the DELPROF.exe tool. I&#8217;ve used it for my latest XenApp rollout, and have found\u00a0that it works really well \ud83d\ude42 See below for further information as to how I have implemented it.<\/p>\n<p><a target=\"_blank\" href=\"http:\/\/www.ctrl-alt-del.com.au\/\">Warren Simondson<\/a> of <a target=\"_blank\" href=\"http:\/\/www.ctrl-alt-del.com.au\/\">Ctrl-Alt-Del IT Consultancy<\/a> has released a command-line utility called <a target=\"_blank\" href=\"http:\/\/www.ctrl-alt-del.com.au\/CAD_TSUtils.htm\">REMProf<\/a> to delete local user profiles that are not in use when this command is executed. <a target=\"_blank\" href=\"http:\/\/andymorgan.wordpress.com\/\">Andy Morgan<\/a> has created a great <a target=\"_blank\" href=\"http:\/\/andymorgan.wordpress.com\/2008\/05\/23\/deleting-a-user-profile-from-multiple-servers\/\">blog<\/a> to demonstrate how usefull this tool can be to remove a user profile from multiple Terminal \/ Citrix servers.<!--more--><\/p>\n<p><strong>Deleteprofiles.cmd &#8220;wrapper&#8221; and Scheduled Task creation script.<\/strong><\/p>\n<p>Place the \u00a0deleteprofiles.cmd and deleteprofile.vbs scripts in the %SystemRoot% (Windows) folder.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;Deleteprofiles.cmd&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n@echo off<br \/>\nSetLocal<br \/>\nSet loglocation=%SystemDrive%\\buildlogs<br \/>\nif not exist %loglocation% md %loglocation%<br \/>\ncscript &#8220;%SystemRoot%\\DeleteProfiles.vbs&#8221; \/L &#8220;%loglocation%\\DeleteProfiles.txt&#8221; \/V<br \/>\nEndLocal<br \/>\nEXIT \/b 0<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>However, and we need to go one step deeper here. I create it as a scheduled task that runs at 2:30am every day. One of the bigest advantages of using a script like this is that is can be run as the\u00a0Local System account, where as Delprof has its issues as documented in\u00a0Microsoft Technet article <a target=\"_blank\" href=\"http:\/\/support.microsoft.com\/kb\/262223\">KB262223<\/a>.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;SceduledTasks.cmd&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n@Echo Off<br \/>\nSCHTASKS \/Create \/TN &#8220;Delete inactive profiles&#8221; \/RU &#8220;NT AUTHORITY\\SYSTEM&#8221; \/ST 02:30 \/SC Daily \/F \/TR &#8220;%SystemRoot%\\DeleteProfiles.cmd&#8221;<br \/>\nEXIT \/B<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>This method is 100% successful and creates a very good log file that can be reviewed as needed.<\/p>\n<p>Thanks again Joe!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Joe Shonk has written a very nice Delete Profiles Script to replace the lack of flexibility found in the DELPROF.exe tool. I&#8217;ve used it for my latest XenApp rollout, and have found\u00a0that it works really well \ud83d\ude42 See below for further information as to how I have implemented it. Warren Simondson of Ctrl-Alt-Del IT Consultancy &#8230; <a title=\"Script to replace Delprof.exe\" class=\"read-more\" href=\"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/2008\/07\/30\/script-to-replace-delprofexe-34\" aria-label=\"Read more about Script to replace Delprof.exe\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[5],"tags":[68,70,69,48],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-scripting","tag-delete-profiles","tag-deleteprofiles","tag-remprof","tag-replace-delprofexe"],"aioseo_notices":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":0,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}