We run the following script at machine startup for all student computers
to delete any stray profiles - all users should have mandatory profiles
except for local admin, domain admin. We also don't want to delete all
users. It gets rid of both the profile and the reference to it in the
registry.
You may want to do something to make sure that you only run this once
(otherwise you'll keep deleting user profiles!). We have a registry key
at HKLM\software\cnwl and set values there for events which have
happened or version numbers of installed software etc. and check that to
make sure certain processes only get run once.
Steve
Set ofso=createobject("scripting.filesystemobject")
root="c:\documents and settings"
Set folder=oFSO.GetFolder(root)
Set flist=folder.subfolders
For Each fo In flist
fname=lcase(fo.name)
If fname<>"administrator" and fname<>"administrator.student" and
left(fname,9)<>"all users" Then
Set f1=oFSO.getfolder(root & "\" & fname)
f1.delete true
End If
Next
Set
objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\def
ault:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\windows nt\currentversion\profilelist"
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
if right(subkey,3)<>"500" then
objreg.deletekey HKEY_LOCAL_MACHINE, strKeyPath & "\" & subkey
end if
Next
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Freddie Coleman III
> Sent: 18 August 2005 23:40
> To: [email protected]
> Subject: [ActiveDir] Delprof.exe en mass
>
>
> I am in the process of creating new profiles for a few
> thousand users. In order to make a clean switch, I will need
> to delete the local cached copy of several user profiles &
> delprof.exe can do this on the individual basis. Has anyone
> had experience using it for thousands of machines, maybe
> writing a script to have it run domain wide?
>
> fred
> List info : http://www.activedir.org/List.aspx
> List FAQ : http://www.activedir.org/ListFAQ.aspx
> List archive:
> http://www.mail-archive.com/activedir%40mail.activedir.org/
>
List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/