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

I need a process/script for deleting multiple manditory profiles.

I work at a college where I am the PC technician.  We have implemented mandatory profiles for all the students on lab computers which are running Windows 7.  I need to find a way to either implement a script that will delete the mandatory profile at log off (on client machine) or run a script that will delete all mandatory profiles on the client machine at once.  My problem is obvious, there are several profiles being saved on each machine.  Also, for some reason when the user logs in more than once he/she is not able to access any secure web site such as their school email.  The only way I can get them to be able to access those web sites is to delete their profile and have them login again creating a new profile.
I have asked networking regarding a Group Policy on this, but it is not a option.
Any, help on this is greatly appreciated.
0
RMG1
Asked:
RMG1
  • 5
  • 5
  • 2
  • +2
1 Solution
 
spinzr0Commented:
You're looking to delete all profiles under c:\users?  Additionally, is UAC enabled?
0
 
mkuehngoeCommented:
your mandatory profile is on th client machines? Usually it is placed on a share on a server. After logoff you can delete the profile on the client by GPO using this one:
MACHINE      Administrative Templates\System\User Profiles      Delete cached copies of roaming profiles
0
 
RMG1Author Commented:
Thank you both for commenting.

Spinzr0: There is a local admin account that I use to get into the machine as a back door.  I want to keep that but get rid of the student’s profiles.  Also, UAC is turned off.

Mkuehngoe: What I am trying to get rid of is the roaming profile that is created on the local machine at first login.  There are so many now it is becoming a problem.  I am aware of GPO, but also wanted to know if there was a way to do it at a local level.  Some type of script or something.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
spinzr0Commented:
This should actually do it for you.  If you want it re-worked to delete everything but a few specific profiles its fairly easy. Let me know if you nee dhelp with it.

http://boeprox.wordpress.com/2011/01/27/use-powershell-to-remove-local-profiles/
0
 
RMG1Author Commented:
spinzr0: Thank you, I will try it on Monday and let you know how it works out.
Have a good w/e.
0
 
spinzr0Commented:
you too.
0
 
mkuehngoeCommented:
For XP or w2k you can use this VBS:

Const LocalDocumentsFolder = "C:\Dokumente und Einstellungen\"

set objFSO = createobject("Scripting.FileSystemObject")
set objFolder = objFSO.GetFolder(localdocumentsfolder)

on error resume next

for each fldr in objFolder.SubFolders
      if not isexception(fldr.name) then
            objFSO.DeleteFolder fldr.path, True
      end if
next


Function isException(byval foldername)
      select case foldername
            case "All Users"
                  isException = True
            case "Default User"
                  isException = True
            case "LocalService"
                  isException = True
            case "NetworkService"
                  isException = True
            case "Administrator"
                  isException = True
            case Else
                  isException = False
      End Select

End Function

Subsitue the constant with your local language folder. Be aware this only works for XP. Under vista or win7 the entries in the registry have also to be deleted or you are running in trouble. We deployed the script by GPO for machines in a school where hundreds of local profiles existed. You can set more exceptions if you like.
0
 
RMG1Author Commented:
Mkuehngoe: Thank you for taking the time to answer my question on this.  We do have some XP machines and even though we are not having the same problem with them as with the Windows 7, it will be nice to have for anything not Windows 7.

Spinzr0:
The script you provided worked well.  I need to tweak it though so that it will delete only mandatory profiles and not local profiles off the client machine and delete them in mass quantities, Is this possible?  
If that is not possible, maybe giving it a range when it asks what profile such as 1-50 and the end result being number 1 through 50 deleted.  At least I could see what I was deleted and avoid deleting the local admin account.
I plan on having the script on a thumb drive that I can carry with me.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I've requested that this question be closed as follows:

Accepted answer: 250 points for mkuehngoe's comment http:/Q_26910337.html#35221589
Assisted answer: 250 points for spinzr0's comment http:/Q_26910337.html#35218543

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
spinzr0Commented:
He said my solution worked, he wa just going to tweak it for his needs.  I had the correct answer.
0
 
spinzr0Commented:
I would have to again object. The other answer is for the wrong OS. I have the same code for XP but the question was for Win 7. Its not relevant.
0
 
South ModModeratorCommented:
I've requested that this question be closed as follows:

Accepted answer: 250 points for spinzr0's comment http:/Q_26910337.html#35218543
Assisted answer: 250 points for mkuehngoe's comment http:/Q_26910337.html#35221589

for the following reason:

All,<br />&nbsp; <br />Following an 'Objection' by spinzr0 (at <a href="http://www.experts-exchange.com/Q_27087735.html">http://www.experts-exchang<wbr />e.com/Q_27<wbr />087735.htm<wbr />l</a>) to the intended closure of this question, it has been reviewed by at least one Moderator and is being closed as recommended by the Expert.<br />&nbsp;<br />At this point I am going to re-start the auto-close procedure.<br />&nbsp;<br />Thank you,<br />&nbsp;<br />SouthMod<br />Community Support Moderator
0
 
RMG1Author Commented:
spinzr0  should get full points, it was Windows 7 that I was looking to get an answer for in  regards to my qustion.
0
 
RMG1Author Commented:
Also, the reason this was not closed and point given was that my 17yr daughter had tried to take her own life twice so it has been very crazy here, sorry guys.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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