RE: [ActiveDir] Delprof.exe en mass

2005-08-19 Thread Steve Rochford
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 fnameadministrator and fnameadministrator.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: ActiveDir@mail.activedir.org
 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/


RE: [ActiveDir] Delprof.exe en mass

2005-08-19 Thread Freddie Coleman III
Thanks for the help.  Does delprof use the /F and how would you use the %i
again?

fred


 Use delprof /C

 For /F %i IN (servernames.txt) do delprof /C:\\%i /D:30 /Q /I

 Put pcnames (fqdn or if you trust your wins resolutions) into
 servernames.txt

 Thank you and have a splendid day!

 Kind Regards,

 Freddy Hartono
 Windows Administrator (ADSM/NT Security)
 Spherion Technology Group, Singapore
 For Agilent Technologies
 E-mail: [EMAIL PROTECTED]

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Freddie Coleman
 III
 Sent: Friday, August 19, 2005 6:40 AM
 To: ActiveDir@mail.activedir.org
 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/



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/


RE: [ActiveDir] Delprof.exe en mass

2005-08-18 Thread freddy_hartono
Use delprof /C

For /F %i IN (servernames.txt) do delprof /C:\\%i /D:30 /Q /I

Put pcnames (fqdn or if you trust your wins resolutions) into servernames.txt

Thank you and have a splendid day!
 
Kind Regards,
 
Freddy Hartono
Windows Administrator (ADSM/NT Security)
Spherion Technology Group, Singapore
For Agilent Technologies
E-mail: [EMAIL PROTECTED]
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Freddie Coleman 
III
Sent: Friday, August 19, 2005 6:40 AM
To: ActiveDir@mail.activedir.org
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/