cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Michael_V
Champion Sweeper III
This action can be used to delete old user profiles from a remote computer.

This example deletes all user profiles not used in the last 180 days.

The tool can be downloaded from the Microsoft website:
http://www.microsoft.com/en-us/download/details.aspx?id=5405

Copy "delprof.exe" to your action folder.

{actionpath}delprof.exe /q /i /c:\\{smartname} /d:180
13 REPLIES 13
DaveDischord
Engaged Sweeper II
I like this Action, but anyone have any thoughts on how to use AD to delete the Disabled user profiles, rather than by age?

Trying to figure that out myself or a better way in lansweeper @DaveDischord 

Esben_D
Lansweeper Employee
Lansweeper Employee
You can create new actions in configuration\Asset Pages.

Do be aware that this is a quite old topic, so I can't guarantee that the original post still works.
rcopestick
Engaged Sweeper
Hello,

I also need some help installing this action and applying it to a number of computers on our network.

Thanks
warlock1663
Engaged Sweeper
Can someone tell me exactly how you get these to work? Sorry for the stupid question but I am fairly new to this aspect of LS. I jest need to know what to save the file as and where I put it to get it to work. Even if there are instructions somewhere I can be pointed to.

Thanks
ws6togo
Engaged Sweeper
What happens to the local Admin account when these scripts are run? We have a local admin account that only IT has the password to perform various administrative functions.
BOFSD
Engaged Sweeper
@dkaczoro
I ran into a similar issues launching the script. Ultimately, I used @BulmersheTech 's script with a couple tweaks. I had to share the default actions folder with my domain admin service account and enable remote registry access via GPO.

I migrated my Lansweeper server from a lab environment to production, so I also had to change the default action path in Lansweeper configuration page.

Here's my cmd file:

@echo off
setlocal
set PSPATH=\\<network path to action folder>
set PC=%1
%PSPATH%\delprof2.exe /c:\\%PC% /d:90 /ntuserini /ed:admin* /i
timeout 20


Increasing the timeout helped troubleshoot the remote registry access error.
dkaczoro
Engaged Sweeper
Trying to use delprof2 as an action in the new Lansweeper and am running across an Access Denied that I never used to get in the old Lansweeper. I click on the action and the Helge Klein window pops up, I say Ok and get the command prompt with the request to delete inactive profiles and type "Y" and really quick before the CMD disappears, I see an Access is Denied message.

Have tried as Built-in user, target workstation Administrator and server Administrator.

action I'm using is: {actionpath}\delprof2.exe /p /c:\\{smartname}

Also tried making delprof2 a deployment option as we have a group of PCs that regularly get bogged down with roaming profiles and being able to clean those as a deployment option would be awesome but so far no luck with that script - just doing a simple one-step CMD script below

{actionpath}delprof2.exe /c:\\{smartname} /r

(have tried it without {actionpath} as well as without the "/c:\\..." trigger and get an "Incorrect function" each time.)

Would appreciate any help with either of these if possible!
BulmersheTech
Engaged Sweeper II
Also using delprof2. Just tweaked a little to give a timeout on the command window.

Create a delprof2.cmd file in the Actions folder

@echo off
setlocal

set PSPATH=\\path-to-your-actions-folder
set PC=%1

%PSPATH%\delprof2.exe /u /i /c:\\%PC% /d:90

timeout 10


The Action then becomes:-

{actionpath}\delprof2.cmd {smartname}


New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now