Profil dont load on login

Posted on 2009-02-11
Last Modified: 2012-05-06
some of my user have a redundant problem on opening ther computer on the morning, while they login the screen is blue and no icon appear, if i do ctrl+alt+delete and i do task manager, file, run and i type explorer and enter all the profil is loadind and everything is fine.

i use vb script to login all the user map drive on domain w2k.

Question by:lmercure
    LVL 27

    Expert Comment

    by:Lukasz Chmielewski
    post the login script maybe the problem is there
    LVL 27

    Expert Comment

    by:Lukasz Chmielewski
    one more thing came to my mind
    do you have a domain ? if so, maybe the gpo referring to login script is waiting for the whole script to load ? the mapping of the drives might stop the explorer to run
    LVL 11

    Expert Comment

    When we have seen this problem, it is either scripts that are running and holding up the login process or the profile is not loading/unloading cleanly.  Try this on one of the problem machines:  If that doesn't help, check for scripts that are running during logon.  Also, read this about optimizing GP for login:  

    Author Comment

    Thanks for the fast response i will see tomorrow, i install the UPHCLEAN and i will send back my comment.


    Author Comment

    ok i try the uphclean and i have the same problem, it could be on my vbScript, any boby know if it's possible to view the vbscript in verbos mode whilw i'm loading the computer.

    sorry for my english...
    LVL 27

    Expert Comment

    by:Lukasz Chmielewski
    post the script

    Author Comment

    There is the script:

    Author Comment

    there is the script:

    sorry for the delay...

    ' Definitions des variables

    Option Explicit
    On Error Resume Next

    Dim username, userdomain, user, usr, computername                              'Variables contenant des informations réseaux
    Dim WshShell, WshNetwork, ConnectionErr, ConnectionErrP                              'Variables utile pour les opérations
    Dim msg, w, grp, Force, UpdateProfile                                          'Variables utile pour les opérations
    Dim i, MapLetter(22), MapGroup(22), MapPath(22), MapResult(22), Mappersi(22), Map, MsgMap            'Variables permettant l'ajout de lecteurs réseaux
    'Dim j, MapR, MsgMapr                                                       'Variables permettant l'ajout des imprimantes

    Set WshShell = Wscript.CreateObject("WScript.Shell")
    Set WshNetwork = WScript.CreateObject("WScript.Network")

    username = WshNetwork.username                                                'Définition de la variable Username
    userdomain = WshNetwork.userdomain                                          'Définition de la variable userdomain
    computername = WshNetwork.computername                                          'Définition de la variable Computername

    user = "//" + userdomain + "/" + username
    Set usr = GetObject("WinNT:" + user + ",user")

    MsgMap = ""                                                            'assignation de valeurs à certaine variable
    MsgMapr = ""                                                            '
    ConnectionErr = 0                                                      '
    ConnectionErrP = 0                                                      '
    Force = True                                                            '
    UpdateProfile = True                                                      'Fin des assignations

    ' Map Assignments
    MapLetter(1) = "E:"                                                      'Lettres qui doit être mappé
    MapGroup(1) = "Utilisa. du domaine"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(1) = "\\MYCOMPfs1\public"                                                            'Chemin du répertoire
    Mappersi(1) = "true"

    MapLetter(2) = "H:"                                                      'Lettres qui doit être mappé
    MapGroup(2) = "Utilisa. du domaine"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(2) = "\\MYCOMPfs1\share1"                                                            'Chemin du répertoire
    Mappersi(2) = "true"

    MapLetter(3) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(3) = "group3"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(3) = "\\MYCOMPfs1\share2"                                                            'Chemin du répertoire
    Mappersi(3) = "true"

    MapLetter(4) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(4) = "group4"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(4) = "\\MYCOMPfs1\share3"                                                            'Chemin du répertoire
    Mappersi(4) = "true"

    MapLetter(5) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(5) = "group5"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(5) = "\\MYCOMPfs1\share3"                                                            'Chemin du répertoire
    Mappersi(5) = "true"                                                            'Chemin du répertoire

    MapLetter(6) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(6) = "group6"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(6) = "\\MYCOMPfs1\share4"                                                            'Chemin du répertoire
    Mappersi(6) = "true"

    MapLetter(7) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(7) = "group7"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(7) = "\\MYCOMPfs1\share5"                                                            'Chemin du répertoire
    Mappersi(7) = "true"

    MapLetter(8) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(8) = "group8"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(8) = "\\MYCOMPfs1\share6"                                                            'Chemin du répertoire
    Mappersi(8) = "true"

    MapLetter(9) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(9) = "group9"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(9) = "\\MYCOMPfs1\share7"                                                            'Chemin du répertoire
    Mappersi(9) = "true"

    MapLetter(10) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(10) = "group10"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(10) = "\\MYCOMPfs1\share8"                                                            'Chemin du répertoire
    Mappersi(10) = "true"

    MapLetter(11) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(11) = "group11"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(11) = "\\MYCOMPfs1\share9"                                                            'Chemin du répertoire
    Mappersi(11) = "true"

    MapLetter(12) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(12) = "group12"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(12) = "\\MYCOMPfs1\share10"                                                            'Chemin du répertoire
    Mappersi(12) = "true"

    MapLetter(13) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(13) = "group13"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(13) = "\\MYCOMPfs1\share11"                                                            'Chemin du répertoire
    Mappersi(13) = "true"

    MapLetter(14) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(14) = "group14"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(14) = "\\MYCOMPfs1\share12"                                                            'Chemin du répertoire
    Mappersi(14) = "true"

    MapLetter(15) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(15) = "group15"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(15) = "\\MYCOMPfs1\share12"                                                            'Chemin du répertoire
    Mappersi(15) = "true"

    MapLetter(16) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(16) = "group16"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(16) = "\\MYCOMPfs1\share13"                                                            'Chemin du répertoire
    Mappersi(16) = "true"

    MapLetter(17) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(17) = "group17"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(17) = "\\MYCOMPfs1\share14"                                                            'Chemin du répertoire
    Mappersi(17) = "true"

    MapLetter(18) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(18) = "group18"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(18) = "\\MYCOMPfs1\share15"                                                            'Chemin du répertoire
    Mappersi(18) = "true"

    MapLetter(19) = "s:"                                                      'Lettres qui doit être mappé
    MapGroup(19) = "group19"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(19) = "\\MYCOMPfs1\share16"                                                            'Chemin du répertoire
    Mappersi(19) = "true"

    MapLetter(20) = "s:"                                                      'Lettres qui doit être mappé
    MapGroup(20) = "group20"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(20) = "\\MYCOMPfs1\share17"                                                            'Chemin du répertoire
    Mappersi(20) = "true"

    MapLetter(21) = "m:"                                                      'Lettres qui doit être mappé
    MapGroup(21) = "group21"                                                      'Groupes auxquels le le mappages doit s'appliquer
    MapPath(21) = "\\MYCOMPfs1\share18"                                                            'Chemin du répertoire
    Mappersi(21) = "true"

    MapLetter(22) = "G:"                                                      'Lettres qui doit être mappé
    MapGroup(22) = "group22"                                                'Groupes auxquels le le mappages doit s'appliquer
    MapPath(22) = "\\MYCOMPfs1\share19"                                                            'Chemin du répertoire
    Mappersi(22) = "true"

    ' Drive connections

    For i= 1 to 22                                                            'Entré dans la boucle pour le mappage des lettres.
       MapResult(i) = "...ok"                                                '
       Map = False                                                        '
       If MapGroup(i) = "Everyone" Then                                          '
          Map = True                                                      '                                          '
       Else                                                                  '
          For each grp in usr.Groups                                          '
             msg = msg + + vbNewLine                                    '
             If MapGroup(i) = Then                                          '
               Map = True                                                      '
             End if                                                            '
          Next                                                            '
       End If                                                            '
       If Map = True Then                                                      '
          WshNetwork.RemoveNetworkDrive Mapletter(i), Force, UpdateProfile                  '
          Err.Clear                                                            '
          WshNetwork.MapNetworkDrive MapLetter(i), MapPath(i), Mappersi(i)                        '
          if Err.Number <> 0 then                                                '
             MapResult(i) = "...Échouée: " + Err.Description                        '
             ConnectionErr = ConnectionErr + 1                                    '
          End If                                                            '
          MsgMap = MsgMap + vbNewLine + MapLetter(i) + " --> " + MapPath(i)                  '
          MsgMap = MsgMap + " " +  MapResult(i)                                    '
       End If                                                            '
    Next                                                                  'Fin de la boucle

    ' Message d'acceuil

    if userdomain = "MYCOMP" then
          msg = "Bienvenue sur le domaine " + vbNewLine + "(" + user+ ")" + vbNewLine                        'Message d'accueil indiquant que vous êtes sur le domaine X.
          msg = "Vous êtes connecté localement sur le poste: " + userdomain + vbNewLine + "(" + user+ ")"                  'Message d'accueil indiquant que vous êtes connecté localement sur le poste.
    end if
    title = "Logon script de MYCOMP.ORG"
    timeout = 5
    If ConnectionErr <> 0 then
       timeout = 0
       If ConnectionErr = 1 then
          MsgMap = MsgMap + vbNewLine + vbNewLine + "Attention! Une connection réseau n'a pu être établie."                  'Message d'accueil envoyé si les connexions réseau ont été établie avec succès
          MsgMap = MsgMap + vbNewLine + vbNewLine + "Attention! Plusieurs connections réseau n'ont pu être établies."      'Message d'accueil envoyé si les connexion réseau N'ONT PAS été établie avec succès.
       End If
    End If
    If MsgMap <> "" then
       MsgMap = vbNewline + vbNewLine + "Activation des connections aux lecteurs suivants:" + MsgMap
       msg = msg + MsgMap
       MsgMapr = vbNewline + vbNewline + "Connection aux imprimantes suivantes:" + MsgMapr                              'Affichage des imprimantes connectés.
       msg = msg + MsgMapr
    End If      

    answer = WshShell.Popup(msg, timeout, title, vbOKonly)

    LVL 27

    Expert Comment

    by:Lukasz Chmielewski
    man, thats a lot of mapping :)

    does you script echo which drive was connected ?
    try to use also

    on error resume next
    so if the drive cannot be mapped you will know which net path was incorrect

    Accepted Solution

    did i have to put this command "on error resume next" on each map connection, and where can i use the echo command and put a time out of 10 sec befor it close.

    thanks, i'm new in vbscripting...the script i use was inplace befor i start to work here.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
    INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
    In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
    Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now