• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 782
  • Last Modified:

Delete profiles

Is there an easy way to delete profiles from computers after a certain amount of inactivity? I'm hoping to be able to achieve this with a group policy or some other remote way so that we do not have to visit each machine.

Thanks in advance!
0
PC-Solutions
Asked:
PC-Solutions
  • 6
  • 5
  • 2
  • +2
1 Solution
 
BAYCCSCommented:
There is no way to delete profiles on a local machine using a GPO.
0
 
clw3388Commented:
sure there is, assuming they are using roaming profiles..

http://support.microsoft.com/kb/274152
0
 
clw3388Commented:
1. Click Start, type GPEDIT.MSC and press ENTER

2. Expand Computer Configuration | Administrative Templates | System

3. Click User Profiles

4. Double-click Delete user profiles older than a specified number of days on system restart

5. Select Enabled, Specify the number of days and click OK.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
BAYCCSCommented:
clw3388 - Would that not be more defining a local policy instead of an AD Group Policy?
0
 
robertodeacruzCommented:
This tip is for Windows Vista. Confirm that it serves there in Windows 2008, please.

1. In an GPO, expand Computer Configuration | Administrative Templates | System
2. Click User Profiles
3. Double-click Delete user profiles older than a specified number of days on system restart
4. Select Enabled, Specify the number of days and click OK.
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
Another thing you can do is create a VBscript to accomplish this. You can have it run at startup and publish this witha  GPO.
Take a look here for an example.
http://www.vistax64.com/vb-script/212981-delete-files-older-than-x-days-folder-its-subfolders.html

Once you have got the VBScript tested and working do the following to use GPO to deploy.
- Open GPMC.msc (on DC)
-  Create a new GPO, give it a name, right click to edit the GPO
- Expand Computer Configuration>Windows Settings>
- Click Scripts (Startup/Shutdown)
- Click Startup script (right hand pane)
- Find your VBS file and apply it to the GPO
- Set your scope where you want the gpo to apply to (what computers)
*make sure you test this with one computer first before launching to multiple ones.

Hope this helps~!
0
 
PC-SolutionsAuthor Commented:
Thanks for all the input guys! I have tried the startup script in a gpo, then assigning it to computers but it never runs. I can run things when it's assigned o specific users, but things wont launch when the scope is defined as computers. Any thoughts?
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
When you are on the machine in question, look in the event viewer and also use rsop.msc (from cmd) as this will help describe why the GPO failed to run on the specified machine.
0
 
PC-SolutionsAuthor Commented:
When i run rsop.msc it just opens up the poilcy on the computer, but it doesn't show the login script in the logon/logoff. Could this be due to the fact that I have many different gpos, with some going to the user and some going to the workstation?

Thanks for you r input!
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
First - when you open rsop.msc right click on "Computer Configuration" or "User Configuration" and click Properties. Once you have done this you will be able to see what GPO's are applied to your machine. You then use the Error Information Tab to see if there has been any policies that have not been applied (due to error or pending).

Second - if you are on the General Tab and do not see the policy in the object window then you have not setup the "Scope" properly on the GPO. Check that you have set the proper scope and try re-applying the GPO to the machine.
0
 
PC-SolutionsAuthor Commented:
Okay, I'm going with option 2 on this one. I don't even get a choice for logon/logoff scripts under computer configuration. This is how I setup the policy.

Open GPO manager
Created a new GPO
Went to computer config, logon/logoff scripts
setup a script based on a unc path
closed the policy
under 'security filter' (with the proper gpo selected) i removed "authenticated users" and replace it with a comuter name, I added the computer name by searching the AD and selecting it.
under security filters it now lists the machine that i am testing this on, but it is followed by a $ (ie test$)

Any more help is SO appreciated.
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
Is the GPO even being applied to the machine or is it just failing? Like I said perviously, you can use rsop.msc to view this information. If you GPO is listed when you launch rsop.msc then it is making it to the computer. Check the Error tab to see what went wrong if it has failed.
0
 
PC-SolutionsAuthor Commented:
Okay, under rsop.msc, i right click on "computer configuration" and choose "error information" and all of the components say "success"

??
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
Ok, backup to the General tap. In there are all of the GPO's that are being applied to your machine. If you do not see your GPO (you have created for this startup script) in this window, then the GPO is not making it to the computer. You will need to take a look at the Scope and Security Filtering to make sure that you are pointing to the proper "OU" and "Group" that you want the to be applied to.

Make sure that if you set your scope to say "Testing OU" and you set your Security Filtering to "Boardroom PC's" then that computer MUST be in the Testing OU and be part of the Boardroom PC's group. If this is not true for either of them the policy will not apply.
0
 
PC-SolutionsAuthor Commented:
Wow, I feel like a moron! :)

Okay, to start, i went to the computer config (in rsop) right clicked and it IS showing the test policy right below the default domain policy. So this means that the policy is reaching the computer right?
 
Thanks for all of your help, we are migrating from netware and having a fun ride...
0
 
PC-SolutionsAuthor Commented:
Okay, so I've summed up that it must have something to do with having a logon script attached to a user and one to a computer. As soon as I moved the test script into the startup script location, it started working.

Is there a way to set it so it will run login scripts for different gpos, one being attached to the user and one being attached to the computer?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now