Recursos para Profesionales de TI > Página principal de foros > The Official Scripting Guys Forum! > [VBScript] I'm looking for a script that will delete a User Profile remoltely
Formular una preguntaFormular una pregunta
 

Pregunta[VBScript] I'm looking for a script that will delete a User Profile remoltely

  • miércoles, 01 de julio de 2009 16:27Enfury Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hello.

    I have a problem going on in my site. We had a virus outbreak, and it put the profile "cypscanner2" on every PC in my site. I got the virus removed from the original PC with the real user profile "cypscanner2" but now I need to remove the user profile "cypscanner2" from all of the other PCs in my site. So my question is, is there a VBscript I can run remotely to remove "cypscanner2" from 'C:\Documents and Settings"? I have virtually 0 scripting expierence so any and all help would be great.

    Thanks in advance.

    Enfury

Todas las respuestas

  • jueves, 02 de julio de 2009 4:18NickHunyady Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Should be as simple as:

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.DeleteFolder "C:\Documents and Settings\cypscanner2", True

    Or remotely:

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.DeleteFolder "\\ServerName\C$\Documents and Settings\cypscanner2", True

  • jueves, 02 de julio de 2009 14:43AbqBillModeradorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hi Nick,

    Using the FileSystemObject object to delete a folder will delete the profile directory, but it won't delete its associated registry path:

    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\user's SID

    There are also two other complications: 1. you can't delete a profile for a user that's logged on; and 2. the user might have logged off, but the profile might not be completely unloaded (see http://support.microsoft.com/kb/837115 ).

    In the meantime, I recommend 'uphclean' and the 'delprof.exe' found in the Resource Kit utilities.

    HTH,

    Bill
  • jueves, 02 de julio de 2009 16:04NickHunyady Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Thanks for adding onto my post Bill. It was late when I posted it and didn't get into much detail. I agree, both apps are good for profile cleaning, although Zenfury only mentioned cleaning it from the %Userprofile% path.