Is there a way to cleanup service account user profile?

Comments

11 comments

  • Shane Corellian

    Hi Ken,

    This is intended behavior. it has to do with the Run As feature in Deploy. By default the Deploy User credentials are used. To avoid this behavior you would need to run the deployments as Local System. Still use the Deploy User credentials (this is required) but have the Run As set to Local System.

    Keep in mind that some steps in packages in the Package Library are hard-coded to Run As Deploy User.

    A profile does need to be created in order to execute deployments. The clean up procedures remove files that were used during the deployment but the actual Windows profile stays.

    0
    Comment actions Permalink
  • Ken Staude

    Thanks Shane, after testing a few of the different combinations I found out exactly what you described. To "clean up" the User Profile folder, I just created a quick package with a "Command" step to do a RMDIR, and having the "Run as" Local System as you had suggested. 

    Should work out just fine for the customer I think. Thanks again for the clarification and suggestions once again!

    0
    Comment actions Permalink
  • Shane Corellian

    Well done, Ken.

    Keep one thing in mind... deleting the directories will prevent the casual user from seeing the other user account profiles but the actual profile still exists in the registry. I'm sure you know this but I just wanted to mention it.

    0
    Comment actions Permalink
  • Ken Staude

    Agreed, that would be the more thorough method. Think I saw another discussion on the forums regarding a utility "Delprof2" that might fit the need too. Thanks again as we were able to cater to the customers needs just fine.

    Bonus that we've sold them on moving forward with an Enterprise license of PDQ Deploy to boot.

    Cheers

    0
    Comment actions Permalink
  • Shane Corellian

    DelProf2 is a great tool. Thanks for everything, Ken.

    0
    Comment actions Permalink
  • Mikael Sjövall

    HI,

     

    We are in school enviroment, and we get lots of profiles in our computers.

    I have used DelProf2 to delete those time to time.

    Now that we are using PDQ softwares (Inv and Deploy) is it possible to combine this userprofile deletion to those apps.??

    Tried to add "custom tool" in PDQInventory, but it did not work (maybe cause need of elevated cmd and remote reg. service started automatic ??)

    I have tried command line : C:\tools\Delprof2\DelProf2.exe /q /c:%TargetIPAddress%

    Do you vise man know a workaround for this issue?

     

    0
    Comment actions Permalink
  • Mikael Sjövall

    What am i doing wrong in "Custom Tool" ? Does it need a command, start ?

    0
    Comment actions Permalink
  • David Mattox

    New to PDQ and trying to get delprof2.exe to work for us as well.  We have multiple remote computers we need to remove old user profiles.  Do we need to copy delprof2 to each computer in a folder to run or can it run from pdq machine?  Any suggestions on getting to work would be appreciated.  Thanks in advance

     

    0
    Comment actions Permalink
  • Stephen Valdinger

    Yes, it will have to be on the local machine for this to work.

     

    You could create a Custom Tool in Inventory to do the work, or create a Package in Deploy with a File Copy Step to put the delprof2.exe file on the target, and then a command step using the exe and the switches you require.  That may be your best route. Using the Custom Tool approach is rather......ugly, but cool!

    0
    Comment actions Permalink
  • Stephen Valdinger

    This works if you have Windows 8.1 or higher (Note, it may work on Windows 7, but I don't have 7 clients to test on):

     

    Get-CimInstance win32_userprofile | Where { $_.localpath -match "useraccountname" } | Remove-CimInstance

     

    That will delete the profile from the computer and can be run as a PDQ Deploy Powershell step in a package, or from the Tools menu in PDQ Inventory.

    0
    Comment actions Permalink
  • Will Sours

    I know this is an old thread, but is there a way to delete the PDQ service account profile? I've tried the powershell method above  but it fails because of locked files.

     

    0
    Comment actions Permalink

Please sign in to leave a comment.