Re: Login Script

Tech-Archive recommends: Fix windows errors by optimizing your registry



Some are authenticating over a LAN and others are authenticating over a WAN.
It happens in both cases. For the ones going over the WAN, they are using a
DC over the WAN as well.

There are no other scripts running at the same time.

"Jeffery Hicks" <"jhicks[at]SAPIEN.com" wrote:

On Mon, 12 Feb 2007 10:20:01 -0800, Kev wrote:

Hi,

I am new to scripting, and have created a login script that runs under a
Group Policy. The problem that I am having is that sometimes when a user logs
in the script seems like it is not running. The user just gets their desktop
background picture and no icons, taskbar, etc. If they press ctrl+Alt+Delete
and logoff and then back on the script runs and all of the icons appear. I
have done all of the updates for the computer as well as windows, and also
checked dns problems. So I think it might have something to do with the
script. Here is what the script looks like, any ideas would be appreciated.

Thanks,
Kevin.

Const GUARDIANSHIP_GROUP = "cn=guardianship"
Const RESOURCES_GROUP = "cn=resources"
Const ADMIN_RUPERT = "cn=rupert admin"
Const ADMIN_GUARDIANSHIP = "cn=guardianship admin"


Set WSHShell = CreateObject("WScript.Shell")


Set oFSO = Wscript.CreateObject ("Scripting.FileSystemObject")
strDsk = WshShell.SpecialFolders ("Desktop")
strshortcut = strDsk & "\Usignin.lnk"
If Not oFSO.FileExists (strshortcut) Then
SET oUrlLink = WshShell.CreateShortcut (strshortcut)
oUrlLink.TargetPath = "http://w2kex-van1-1/usignin/";
oUrlLink.Save
End If

Set oFSO = Wscript.CreateObject ("Scripting.FileSystemObject")
strDsk = WshShell.SpecialFolders ("Desktop")
strshortcut = strDsk & "\DTS.lnk"
If Not oFSO.FileExists (strshortcut) Then
SET oUrlLink = WshShell.CreateShortcut (strshortcut)
oUrlLink.TargetPath = "https://dts.gov.bc.ca";
oUrlLink.Save
End If

Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:", "\\w2kfs-van1-1\users\" & wshNetwork.UserName
wshNetwork.MapNetworkDrive "t:", "\\w2kfs-van1-1\templates"

set objNetwork = CreateObject ("WScript.Network")


Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://"; & ADSysInfo.UserName)

colGroups = CurrentUser.MemberOf
If IsEmpty(colGroups) Then
strGroups = ""
ElseIf TypeName(colGroups) = "String" Then
strGroups = LCase(colGroups)
Else
strGroups = LCase(Join(colGroups))
End If

If Instr(strGroups, GUARDIANSHIP_GROUP) Then

wshNetwork.MapNetworkDrive "g:", "\\w2kfs-van1-1\guardianship share"
objNetwork.AddWindowsPrinterConnection "\\vacfss-rupert\Guardianship1"
objNetwork.AddWindowsPrinterConnection "\\vacfss-rupert\Guardianship2"

End If

If Instr(strGroups, RESOURCES_GROUP) Then

wshNetwork.MapNetworkDrive "r:", "\\w2kfs-van1-1\resources share"
objNetwork.AddWindowsPrinterConnection "\\vacfss-rupert\Resources1"

End If

If Instr(strGroups, ADMIN_RUPERT) Then

wshNetwork.MapNetworkDrive "i:", "\\w2kfs-van1-1\rupert-admin"
wshNetwork.MapNetworkDrive "s:", "\\w2kfs-van1-1\reception"
objNetwork.AddWindowsPrinterConnection "\\vacfss-rupert\Resources1"
objNetwork.AddWindowsPrinterConnection "\\vacfss-rupert\Guardianship2"
objNetwork.AddWindowsPrinterConnection "\\vacfss-rupert\DP-4510"

End If

I don't see any red flags in your script. Are the clients who have
problems on the LAN or authenticating over a WAN? Do they authenticate to a
local DC or one over a WAN? If they are connecting over slow links,you may
have other Group Policy processing issues as well.

Are there other computer startup or user logon scripts running at the same
time?

--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
VBScript & Windows PowerShell Training -
www.ScriptingTraining.com/classes.asp
Windows PowerShell? - www.SAPIENPress.com/powershell.asp

blog: http://blog.SAPIEN.com
blog: http://jdhitsolutions.blogspot.com

.



Relevant Pages

  • Re: Logon script problems logging onto another domain in forest
    ... I meant authenticating with a DC in a ... a share by the Dfs client. ... The user account stipulates that this script ... The netlogon folder is accessed by the Dfs ...
    (microsoft.public.windows.server.active_directory)
  • Re: RH8/Apache -- Host Resolution Error
    ... Here is a perl script to find out your WAN IP, the one your ISP gave you. ... You can use it along with the command "host yourdomain.com" then update ... Its also a good idea to add the DNS service providers DNS server to your ...
    (linux.redhat)
  • Re: log into a system
    ... You can do this with a DOS or WSH script. ... You can leave the password off, and you will be prompted for it when the script is ran. ... oWS.PopUp "Connection to one or more shares failed!", 3, "ERROR: Authenticating", vbExclamation ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: WAN - IP Addr Check
    ... and this client can certainly send an email when your wan address changes. ... Theres a neat feature that allows you to collect the address from the router ... contact a whois server and return his WAN side IP addr. ... I would alter my script so if the ...
    (microsoft.public.windowsxp.network_web)
  • Re: WAN - IP Addr Check
    ... and this client can certainly send an email when your wan address changes. ... Theres a neat feature that allows you to collect the address from the router ... contact a whois server and return his WAN side IP addr. ... I would alter my script so if the ...
    (microsoft.public.windowsxp.network_web)