?
Solved

Logon Scripts

Posted on 2005-03-15
13
Medium Priority
?
483 Views
Last Modified: 2012-06-21
We are converting from a Novell environment to a Windows 2003 server. Is there a way to convert the logon scripts currently used under Novell so that they will do/work the same under windows? And if so, what needs to be configured on the windows server to accept them?
0
Comment
Question by:cpwilson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +2
13 Comments
 
LVL 8

Expert Comment

by:Marakush
ID: 13546719
cpwilson,

One of GSNW's primary uses is to prepare to move users from NetWare to NT. You can move users one at a time, transferring their accounts while leaving them the option to retrieve files from their old NetWare server. Or you can move all the users and their data from a NetWare server to NT

http://www.windowsitpro.com/Windows/Articles/ArticleID/93/pg/2/2.html

This is from OCT97 So I would check the administrators resources on your CD

---SNIP---
" The Migration Tool for NetWare (in NT Server's Administrative Tools) automates the process. "

Hope this points you in the right direction.

As for me, I just re-wrote the scripts from scratch. It was easyer.

Marakush
0
 

Author Comment

by:cpwilson
ID: 13546903
Relatively new to server 2003, can you possibly assist with showing me what a generic script shouild look like. Have tried several from different sources and nothing seems to work.
0
 
LVL 18

Expert Comment

by:luv2smile
ID: 13547106
What are you  trying to do with the login script? \

For basic drive and printer mapping, I find this site as a good reference:

http://www.computerperformance.co.uk/Logon/logon_scripts.htm
0
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 

Author Comment

by:cpwilson
ID: 13547360
Tried that script--nada (in fact, this was the FIRST one I tried). Basically, need to map drives and printers, same as with novell
0
 
LVL 12

Expert Comment

by:GinEric
ID: 13547362
0
 
LVL 18

Expert Comment

by:luv2smile
ID: 13547703
The link I posted walks you thru using WSH scripting and gives sample basic scripts :)

cpwilson,

If you followed the exact script sample with only changing the variables, then you shouldn't have a problem. So we need to look at exactly what the problem is because the script works fine so something is either wrong with your script or how you are implementing it.

Does the script work by itself? meaning can you doulbe click on the script and have it map the driver or printer?

How are you implementing it? Thru group policy?   You have to make sure the script is located in the correct folder or it won't work.

0
 
LVL 2

Expert Comment

by:keenemarin
ID: 13549838
Gosh.

Having just recently (February) done exactly the same thing - i.e. moved network from Novell to W2k3 Domain, I do know alot about this area.

Your current login scripts need to be changed. I would recommend using KIXTART (www.kixtart.org), they have proved to be reliable, and easy to implement. Actual conversion of scripts is almost pointless as the syntax is varied etc.

As for implementation, its fairly straightforward. On your new server, go to the group policy, select that, edit it, and find the user section, in there under windows settings, you will find an entry for logon scripts, just point that to a location on your server (usually \\servername\netlogon\script.bat). Thats the way we did it here, but we were setting up a windows domain, which is slightly different from just a simple file server environment.

for more on kix scripts : http://www.scriptlogic.com/Kixtart/htmlhelp/default.asp thats a list of the kix commands and their syntax. For us, getting to know kix was slow, but now the scripts are doing ludicrously complex things for us in an on-demand basis.

Keene
0
 
LVL 12

Expert Comment

by:GinEric
ID: 13570601
did he get anywhere with this yet; we did it pretty much the same way that keenemarin suggested.

script.bat in canonical names.
0
 

Author Comment

by:cpwilson
ID: 13623018
This is DRIVING ME CRAZY!!!! Following script is what I am attempting to use (have tried so many now, forget where this one came from). Only the part that starts the browser works. NONE of the other suggestions have appeared to do me any good

'   declare variables
dim wshnetwork
dim ie

'   suppress error messages
on error resume next

'   set reference to WSH network object
set wshnetwork=wscript.createobject("wscript.MYSERVERNAME")

'   remove network drive in case it is already in use
wshnetwork.removenetworkdrive "z:"

'   add network drive
wshnetwork.mapnetworkdrive "z:","\\MYSERVERNAME\technology"
wshnetwork.mapnetworkdrive "r:","\\MYSERVERNAME\research"


'   add connection to a network printer
wshnetwork.addwindowsprinterconnection "\\MYSERVERNAME\hp5"

'   set new printer as default printer
wshnetwork.setdefaultprinter "\\MYSERVERNAME\hp5"


' EVERYTHING FROM HERE DOWN WORKS

'   set reference to Internet Explorer object
set ie=createobject("internetexplorer.application")

'   load microsoft home page
ie.navigate"http://www.MYWEBSITE.COM"

'   make application visible
ie.visible=true
0
 

Author Comment

by:cpwilson
ID: 13624681
This is what I ended up with that appears to properly work (with a couple of exceptions)

' ########################################################################
'  Written in VBScript.
'  Paul DeBrino .:. www.infinity-rd.com .:. March 2004.
'  Establishes map drives.
'  Assign to OU Group Policy under USER CONFIG, WINDOWS SETTINGS, SCRIPTS, LOGON SCRIPT.
'
'  This script will:
'  (1) check if the drive is already connected and, if so, disconnect it.
'  (2) map the drive.
'
'  Arguments are as follows:
'     MAPIT  DRIVE-LETTER as string,  PATH as string, USER as string, PASSWORD as string
'     (1) Do not specify colon in drive letter.
'     (2) Do not end path with a forward slash.
'     (3) If user and password are not required to establish map, then specify a zero-length string as follows:  ""
'
' Reference Microsoft info at:
' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthmapnetworkdrive.asp
' ########################################################################

' Create the Shell or environment for the commands:
Set WshShell = WScript.CreateObject("WScript.Shell")
' Define objects:
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oDrives = WshNetwork.EnumNetworkDrives()

' ====================================
' DEFINE WHO TO CONTACT for pop-up messages:
' ====================================
strContactMessage = "If you require assistance, please contact IT Support."

' ==================
' DEFINE DRIVES TO MAP:
' ==================
Mapit "Z", "\\rilegalserver\technology", "", ""
Mapit "R", "\\rilegalserver\research", "", ""
Mapit "F", "\\rilegalserver\user\%username%", "", ""
Mapit "T", "\\rilegalserver\apps", "", ""
Mapit "G", "\\rilegalserver\wp\%username%", "", ""
Mapit "U", "\\rilegalserver\time", "", ""


' ==========================
' setup printer
' ===========================

Set objWSHNetwork = CreateObject("WScript.Network")  'create network object
strConnectString = "\\rilegalntserver\ir7200_ps\ir7200"
strResult = objWSHNetwork.AddWindowsPrinterConnection(strConnectString)

' ========== end printer setup ===============

' ========
' CLEAN UP:
' ========
Set WshShell = Nothing
Set WshNetwork = Nothing
Set oDrives = Nothing

' ===================
'   set reference to Internet Explorer object
' ===================
set ie=createobject("internetexplorer.application")

'   load microsoft home page
ie.navigate"http://www.rils.org"

'   make application visible
ie.visible=true





' ##################################
' DO NOT MODIFY ANYTHING BELOW THIS POINT...
'   unless you are familiar with the proper settings.
' ##################################
Sub Mapit(strLetter, strPath, strUser, strPass)

    ' Define the DriveLetter:
    DriveLetter = strLetter & ":"

    ' Define the remote path:
    RemotePath = strPath

    ' Pop-up Notices (set to False to disable notices, otherwise set to True):
    bPopReminder = False

    ' Define known errors to trap:
    Dim arrErrCode(1)
    Dim arrErrDesc(1)
    arrErrCode(0) = -2147023694
    arrErrCode(1) = -2147024811
    arrErrDesc(0) = "Unable to map drive " & DriveLetter & " to " & RemotePath _
        & " due to a previously defined remembered map with the same letter." _
        & vbCrLf & vbCrLf & "Please MANUALLY disconnect map drive " & DriveLetter _
        & ", then Log Out and Log back in."
    arrErrDesc(1) = "Unable to map drive " & DriveLetter & " to " & RemotePath _
        & " since " & DriveLetter & ": was previously reserved by your computer." _
        & vbCrLf & vbCrLf & "(Refer to Management, Shared Folders, Shares)"

    ' Define whether the map information should be removed from the current user's profile:
    bForceRemoveFromProfile = True
    bRemoveFromProfile = True

    ' Define whether the map information should be stored in the current user's profile:
    bStoreInProfile = False

    ' Check if already connected:
    AlreadyConnected = False
    For i = 0 To oDrives.Count - 1 Step 2
        If LCase(oDrives.Item(i)) = LCase(DriveLetter) Then AlreadyConnected = True
    Next

    ' Attempt to map the drive.  If already mapped, first attempt disconnect:
    If AlreadyConnected = True then
        WshNetwork.RemoveNetworkDrive DriveLetter, bForceRemoveFromProfile, bRemoveFromProfile
        If Not strUser = "" Then
            WshNetwork.MapNetworkDrive DriveLetter, RemotePath, bStoreInProfile, strUser, strPass
        Else
            WshNetwork.MapNetworkDrive DriveLetter, RemotePath, bStoreInProfile
        End If
        If bPopReminder Then WshShell.PopUp "Drive " & DriveLetter & " disconnected, then connected successfully to " & RemotePath
    Else
        On Error Resume Next
        If Not strUser = "" Then
            WshNetwork.MapNetworkDrive DriveLetter, RemotePath, bStoreInProfile, strUser, strPass
        Else
            WshNetwork.MapNetworkDrive DriveLetter, RemotePath, bStoreInProfile
        End If
        If Err.Number <> 0 Then
            bKnownError = False
            For I = LBound(arrErrCode) To UBound(arrErrCode)
                If Err.Number = arrErrCode(I) Then
                    bKnownError = True
                    strPopMessage = arrErrDesc(I)
                    ' Display the Disconnect Network Drives window:
                    If Err.Number = arrErrCode(0) Then
                        Set objWSH = Wscript.CreateObject("WScript.Shell")
                        objWSH.Run "rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL Disconnect", 1, true
                    End If
                    Exit For
                End If
            Next
            If Not bKnownError Then
                strPopMessage = "Unable to map drive " & DriveLetter & " to " & RemotePath _
                    & " due to reason stated below."
            End If
            ' Display warning message:
            strPopMessage = "WARNING!!   WARNING!!   WARNING!!   WARNING!!" _
                & vbCrLf & vbCrLf & strPopMessage _
                & vbCrLf & vbCrLf & Err.Description & " (error " & Err.Number & ")" _
                & vbCrLf & vbCrLf & strContactMessage
            WshShell.PopUp strPopMessage
        Else
            If bPopReminder Then WshShell.PopUp "Drive " & DriveLetter & " connected successfully to " & RemotePath
        End If
    End If

    ' Release resources:
    Set objWSH = Nothing

    ' Slight pause to ensure each pass has time to commit:
    wscript.sleep 200
End Sub
0
 
LVL 2

Accepted Solution

by:
keenemarin earned 1500 total points
ID: 13625020
I see you went with VB Script.

Just a little FYI, using kixtart (as I suggested), all you would have needed is:

USE H: "\\servername\username$" ;homedrive
;whatever other drives you need to map, do something similar...

ADDPRINTERCONNECTION("\\server\printer")
;for printers...

AND finally...
RUN "%systemroot%\Program Files\Internet Explorer\iexplore.exe http:\\www.whateversiteyouwant.com" ;probably works, if not just a straight RUN "http:\\www.whateversiteyouwant.com" would likely open up the default browser for you to that site.

But, kudos to you, if the VB script works for you, then by all means use it. Just seems like that 100 line epic you posted above seems like overkill for essentially a 5 line script.

Keene
0
 
LVL 2

Expert Comment

by:keenemarin
ID: 13625061
Just a little something else, if you do feel like switching over to KIXTART, then just use http://www.scriptlogic.com/Kixtart/htmlhelp/default.asp
 as a good starting place, it has all the commands, and you can use IF THEN statements, which make life incredibly easy, things like If InGroup "blah" is truly wonderful.

Keene
0
 

Author Comment

by:cpwilson
ID: 13625167
May still endup going with kixtart scripts, but had tried several configurations whcih did not work for me. The one I posted is the only thing that has appeared to work consistently.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Suggested Courses

777 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