Notification

Icon
Error

Delete old user profiles

Posted: Tuesday, November 18, 2014 11:06:12 AM(UTC)
Michael.V

G-Numerator

Member Original PosterPosts: 255
3
Like
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...oad/details.aspx?id=5405

Copy "delprof.exe" to your action folder.

Code:
{actionpath}delprof.exe /q /i /c:\\{smartname} /d:180
ukaussi
#1ukaussi Member Posts: 11  
posted: 12/10/2014 10:40:49 PM(UTC)
Does this work in Win7 as I thought it only worked up to XP?
Michael.V
#2Michael.V Member Original PosterPosts: 255  
posted: 12/11/2014 10:10:56 AM(UTC)
from the Microsoft site:

Delprof.exe is a command-line utility that you can use to delete user profiles on a local or remote computers running Windows 2000, Windows XP, and Windows Server 2003.
sukaitsu
#3sukaitsu Member Posts: 54  
posted: 12/11/2014 2:19:34 PM(UTC)
It works fine on our clients!

Tested on:

Windows XP
Windows Vista
Windows 7
Windows 8
Windows 8.1
Windows Server 2003
Windows Server 2008
Windows Server 2008R2
Windows Server 2012
Windows Server 2012R2

Thank you,

Jeffrey
Dogeron
#4Dogeron Member Posts: 7  
posted: 12/16/2014 12:32:08 PM(UTC)
I use delprof2 which you can find at

https://helgeklein.com/free-tools/delprof2-user-profile-deletion-tool/

I like to have feedback so my action is :

Quote:
{actionpath}\delprof2.exe /u /i /c:\\{smartname} /d:90


for those that don't just use the /q :

Quote:
{actionpath}\delprof2.exe /u /i /q /c:\\{smartname} /d:90


Enjoy.
BulmersheTech
#5BulmersheTech Member Posts: 10  
posted: 3/25/2015 11:47:06 AM(UTC)
Also using delprof2. Just tweaked a little to give a timeout on the command window.

Create a delprof2.cmd file in the Actions folder

Code:
@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:-

Quote:
{actionpath}\delprof2.cmd {smartname}


dkaczoro
#6dkaczoro Member Posts: 3  
posted: 5/10/2016 5:28:26 PM(UTC)
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!
BOFSD
#7BOFSD Member Posts: 2  
posted: 5/19/2016 10:06:41 PM(UTC)
@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:

Quote:
@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.
ws6togo
#8ws6togo Member Posts: 1  
posted: 4/7/2017 6:36:26 PM(UTC)
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.
warlock1663
#9warlock1663 Member Posts: 15  
posted: 9/7/2017 7:14:30 PM(UTC)
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
rcopestick
#10rcopestick Member Posts: 2  
posted: 9/13/2018 2:10:35 PM(UTC)
Hello,

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

Thanks
Esben.D
#11Esben.D Member Administration Posts: 1,873  
posted: 9/14/2018 8:36:49 AM(UTC)
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.
DaveDischord
#12DaveDischord Member Posts: 2  
posted: 7/30/2019 6:18:28 PM(UTC)
I like this Action, but anyone have any thoughts on how to use AD to delete the Disabled user profiles, rather than by age?

Active Discussions

Lansweeper Lansweeper --> PowerBI
by  Hendrik.VE   Go to last post Go to first unread
Last post: Today at 12:13:59 PM(UTC)
Lansweeper Report 32 or 64bit software
by  Phofman  
Go to last post Go to first unread
Last post: Today at 11:06:17 AM(UTC)
Lansweeper Deployment issue with certain installer
by  Ruben1   Go to last post Go to first unread
Last post: Today at 10:36:38 AM(UTC)
Lansweeper Mail notification Windows Defender
by  MB@CC-IT  
Go to last post Go to first unread
Last post: Today at 8:00:59 AM(UTC)
Lansweeper Change Management - Voting and Tracking
by  hrhansen   Go to last post Go to first unread
Last post: Today at 7:46:23 AM(UTC)
Lansweeper Lansweeper email Support
by  Esben.D  
Go to last post Go to first unread
Last post: Yesterday at 5:58:17 PM(UTC)
Lansweeper Scanning Methods
by  CyberCitizen   Go to last post Go to first unread
Last post: Yesterday at 1:12:34 AM(UTC)
Lansweeper Asset Group Config
by  CyberCitizen  
Go to last post Go to first unread
Last post: Yesterday at 1:10:54 AM(UTC)