Quantcast
Channel: Group Policy forum
Viewing all articles
Browse latest Browse all 19997

Questions about removing local profiles ....

$
0
0

Hi,

We've got a 2K3 server, our strategy isn't to use roaming profile.

The document settings folder of some computers are exploding with local profiles providing by the server.

The actual strategy hasn't any effects on older than a specified time.

I decide to use this vb script, in correlation with a GPO to remove local profiles older than 30 days for example :

'Day numbers paramiter 
strNumberDays = 30

 
Set ObjFSO = CreateObject("Scripting.FileSystemObject") 
If  ObjFSO.FolderExists("C:\Documents and Settings\") Then Set ObjFolder = ObjFSO.GetFolder("C:\Documents and Settings\") 
If  ObjFSO.FolderExists("C:\Users\") Then Set ObjFolder = ObjFSO.GetFolder("C:\Users\") 
 
On error resume next 
 
For each ObjFolder in ObjFolder.SubFolders 
    If not isexception(ObjFolder.name) and DateDiff("d", ObjFolder.DateLastModified,Now) > strNumberDays  then 
        objFSO.DeleteFolder ObjFolder.path, True 
    End if 
Next 
 
'Attention to Folders Exception 
Function isException(byval foldername) 
    select case foldername 
        case "All Users" 
            isException = True 
        case "Default User" 
            isException = True 
        case "Default" 
            isException = True 
        case "LocalService" 
            isException = True 
        case "NetworkService" 
            isException = True 
        case "Administrator" 
            isException = True 
        case "Adm-Pass" 
            isException = True 
        case "AppData" 
            isException = True 
        case "Classic .NET AppPool" 
            isException = True 
        case "Public" 
            isException = True 
        case Else 
            isException = False 
    End Select 
End Function

This script works perfectly with XP host and Seven host too.

What sort of GPO should I use to run this vbs, some computers have about 10GB older profiles, so start this strategy at launch time should be a very bad idea.

Should I remove something else, like in key in the registry database ???

Someone tell me that, if I only remove the local profile folder, it should a problem with the host operating system.

Thank you for your answers,

Philippe






Viewing all articles
Browse latest Browse all 19997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>