Deleting profiles older than 7 days with SCCM

Can anyone tell me if it is possible to delete profiles on workstations with SCCM that are older that 7 days?  I know there is a GPO for this, but it doesn't appear to be working.  My thinking is I can run a script Script in SCCM every Friday to do the same thing.

August 31st, 2015 2:45pm

Well you could use this porwershell script and have SCCM run it.

https://gallery.technet.microsoft.com/scriptcenter/How-to-delete-user-d86ffd3c

not sure it`s the best approach to have SCCM take care of this.

So you could just make a package with a deployment that run every X day.
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 2:48pm

Well you could use this porwershell script and have SCCM run it.

https://gallery.technet.microsoft.com/scriptcenter/How-to-delete-user-d86ffd3c

not sure it`s the best approach to have SCCM take care of this.

So you could just make a package with a deployment that run every X day.
August 31st, 2015 6:45pm

worked great only one problem, Any ideas how to make it run silently?  I am no powershell expert!
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 1:11pm

in the deployment of the application under the user experience  did you try using hidden ?
September 8th, 2015 1:14pm

I have not, I ran the Script stand alone to see what the behavior would be, this is when I noticed that it confirms deletion for the profiles.

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 1:16pm

Yeah the script itself would need some modification to be able to run via SCCM like that. The goal was to take what you want from the script and modified it to your liking.

The simple thing you could change is to remove the part where the powershell script ask for Yes it's the section called $choice you would need to reflect the removal of it in all the section.

 
September 8th, 2015 1:27pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics