Link to home
Start Free TrialLog in
Avatar of jasetechtt
jasetechtt

asked on

login script not running properly with windows 2003

My login script does not run properly unless the user has admin rights

can anyone help me, i think the problem stems from the the join command in the script

Const LEGAL                = "cn=legal"
Const ADMINISTRATOR   = "cn=admin"
Const HUMAN_RESOURCES = "cn=hr"
Const estates             = "cn=estates"

Set wshNetwork = CreateObject("WScript.Network")
rem wshNetwork.MapNetworkDrive "t:", "\\amdk6\Users\" & wshNetwork.UserName

Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))

If InStr(strGroups, legal) Then

 wshNetwork.MapNetworkDrive "l:", "\\amdk6\legalfolder"
  wshNetwork.AddWindowsPrinterConnection "\\amdk6\hpbwexec"
   wshNetwork.AddWindowsPrinterConnection "\\amdk6\hpbwgen"
    wshNetWork.SetDefaultPrinter "\\amdk6\hpbwgen"

 ElseIf InStr(strGroups, estates) Then

  wshNetwork.MapNetworkDrive "l:", "\\amdk6\estates"
   wshNetwork.AddWindowsPrinterConnection "\\PrintServer\hpbwnorth"
     wshNetwork.AddWindowsPrinterConnection "\\amdk6\hpbwgen"
      wshNetWork.SetDefaultPrinter "\\PrintServer\Hrbwnorth"

End If
      
Avatar of jhautani
jhautani
Flag of Finland image

>   wshNetwork.AddWindowsPrinterConnection "\\PrintServer\hpbwnorth"
>     wshNetwork.AddWindowsPrinterConnection "\\amdk6\hpbwgen"
>      wshNetWork.SetDefaultPrinter "\\PrintServer\Hrbwnorth"

Is there a typo in your script: ...\hpbwnorth <-> ...\Hrbwnorth
Avatar of jasetechtt
jasetechtt

ASKER

yes there is, thanks
I corrected that but the problem this persist
any more suggestions
yes there is, thanks
I corrected the script but the problem still persist

post any suggestions
ASKER CERTIFIED SOLUTION
Avatar of jhautani
jhautani
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks it worked
I am just wondering... if my suggestion works, then why 'C' ?

https://www.experts-exchange.com/help.jsp#hi73
Well i am sorry i apologise i had to do some research myself, but you deserve a B
i have only now read how this this site grade the answers

accept my apology