Novell Home

Connecting to a NetWare Server using the UNC Path

Novell Cool Solutions: Tip
By Oliver Fischer

Digg This - Slashdot This

Posted: 20 Feb 2007
 

ENVIRONMENT:
-Client 4.91 Sp2
-XP Client
-ZfD Agent 7.01

PROBLEM: In the Novell Client 4.91 Sp2, sometimes there were problems connecting to a NetWare server using the UNC Path -- trying to resolve it over a DNS Server.

For instance:
\\zenserver\VOL1
Zenserver is resolveable over a DNS Server and pointed to a NetWare Server such as ABCNW01.

Solution

A workaround is to put the "zenserver" and the ip address of the NetWare server in the host file. In a larger environment with different networks and "zenserver" addresses, when you must be variable at the client side in which network you are, take this "zenserver".

Here is a VB Script you can distribute via a NAL Object over a pre-distribution script and associate to your workstation. Before the user logs in the script is distributed and in Network A you have the "zenserver" entry with the NetWare Server A in this network.

objFSO.DeleteFile("C:\Windows\System32\Drivers\ETC\HOSTS.TMP")
Set objFile2 = objFSO.CreateTextFile("C:\Windows\System32\Drivers\ETC\HOSTS.TMP")
objFile2.Close
Set objFile2 = objFSO.OpenTextFile("C:\Windows\System32\Drivers\ETC\HOSTS.TMP", ForWriting)
Set objFile1 = objFSO.OpenTextFile("C:\Windows\System32\Drivers\ETC\HOSTS", ForReading)


REM wscript.echo "Change Zenserver in Host File"

REM wscript.echo "1. in welchem Netz bin ich angemeldet"


strComputer = "."
Set objWMIService = GetObject( _ 
    "winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
    ("Select IPAddress from Win32_NetworkAdapterConfiguration ")

For Each IPConfig in IPConfigSet
    If Not IsNull(IPConfig.IPAddress) Then 

        For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)

                  REM 1. Feststellen der IP des Adapters

                  ipstr = IPConfig.IPAddress (i)
                  REM wscript.echo ("Adapter mit IP Adresse " & ipstr & " gefunden")
                  
                  REM 2. Wenn die IP einen best. Wert enth?lt setze den Zenserver entsprechend ansonsten Setze Default Server

          REM Configure All your possible Networks here, such as:

                  IF InStr (ipstr, "172.20.98.") Then
                       ZenAddress="172.20.98.10"
                       REM wscript.echo("ABC Netz gefunden ZenAddress gesetzt auf " & ZenAddress)                       
                  End If     
                                
                  If InStr (ipstr, "172.20.99.") Then         
                       ZenAddress="172.20.99.10"
                       REM wscript.echo("ABC2 Netz gefunden ZenAddress gesetzt auf " & ZenAddress) 
                  End If                                            
                  
                                    
         Next
    End If
Next

                REM wscript.echo "Ihre aktuelle ZenServer Addresse ist=" & ZenAddress

                 REM Hosts einlesen suchen nach Eintrag zenserver und schreiben 
                   treffer = false
                   
                   Do While objFile1.AtEndOfStream = False
                     strLine = objFile1.ReadLine
                        REM wscript.echo "Lese Hosts Zeile = " & strLine                     
                          if InStr( strLine, "zenserver") then 
                              REM wscript.echo " Zeile Zenserver Eintrag in Host gefunden=" & strLine
                              objFile2.Writeline(ZenAddress & "   zenserver")
                              treffer = true
                             REM wscript.echo " Schreibe aktuelle Zeile Zenserver Eintrag in Host.TMP=" & ZenAddress & "   Zenserver"
                             Else                                                           
                              objFile2.Writeline (strLine)
                              REM wscript.echo "Schreibe Hosts Zeile in Hosts.tmp=" & strLine  
                          End if          
                   Loop
                   
                   If treffer = false Then
                   objFile2.Close
                   Set objFile2 = objFSO.OpenTextFile("C:\Windows\System32\Drivers\ETC\HOSTS.TMP", ForAppending)
                        objFile2.Writeline(ZenAddress & "   zenserver")                   
                   End If
        
        Rem Hosts.tmp nach hosts kopieren
                   
                   
        objFSO.CopyFile "C:\Windows\System32\Drivers\ETC\HOSTS.TMP" , "C:\Windows\System32\Drivers\ETC\HOSTS", OverwriteExisting

If you have any questions you may contact Oliver at olli.fischerTAKETHISOUT@gmx.net


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell