none
DFS的功能,如何控制USER存取的是當地的資料夾? RRS feed

  • 問題

  •  

    DFS的功能,用戶端是否真的可以自己手動啟動與關閉?

    點分佈在台北(副本)、上海(副本)、 珠海(主資料料夾)
    如何控制USER存取的是當地的資料夾?

    2008年1月30日 上午 02:00

解答

所有回覆

  • 小弟有一笨方法 提供您參考

    於網域建立一登入執行檔如入


    %LOGONSERVER%\SYSVOL\THEC.LOCAL\SCRIPTS\CHK_GATEWAY.VBS
    IF ERRORLEVEL==4 GOTO SR4
    IF ERRORLEVEL==3 GOTO SR3
    IF ERRORLEVEL==2 GOTO SR2
    IF ERRORLEVEL==1 GOTO SR1

    GOTO END
    Tongue TiedR4
    SET SVR_NAME=\\SVR4
    GOTO END
    Tongue TiedR3
    SET SVR_NAME=\\SVR3
    GOTO END
    Tongue TiedR2
    SET SVR_NAME=\\SVR2
    GOTO END
    Tongue TiedR1

    SET SVR_NAME=\\SVR1

    :END

     

    net use X: %SVR_Name%\XXXX

    .

    .

    .

    .

     

    下為CHK_Geateway.vba 的內容

    IP 位址 請自行修改

     

     

     

    arAddresses = GetIPAddresses()

    svr1 =1
    svr2 =2
    svr3 =3
    svr4 =4
    info = ""
    arAddresses = GetIPAddresses()

    for each ip in arAddresses
        info = info & ip
    next
    if info = "192.168.10.1"   then
    '  WScript.echo info
      wscript.quit ( svr4 )

    elseif info="192.168.11.1" then
      wscript.quit ( svr3 )

    elseif info="192.168.1.1" then
      wscript.quit ( svr2 )  

    else
      WScript.echo info

    end if

     


    Function GetIPAddresses()
    '=====
    ' Returns array of IP Addresses as output
    ' by ipconfig or winipcfg...
    '
    ' Win98/WinNT have ipconfig (Win95 doesn't)
    ' Win98/Win95 have winipcfg (WinNt doesn't)
    '
    ' Note: The PPP Adapter (Dial Up Adapter) is
    ' excluded if not connected (IP address will be 0.0.0.0)
    ' and included if it is connected.
    '=====
      set sh = createobject("wscript.shell")
      set fso = createobject("scripting.filesystemobject")

      Set Env = sh.Environment("PROCESS")
      if Env("OS") = "Windows_NT" then
        workfile = fso.gettempname
        sh.run "%comspec% /c ipconfig > " & workfile,0,true
      else
        'winipcfg in batch mode sends output to
        'filename winipcfg.out
        workfile = "winipcfg.out"
        sh.run "winipcfg /batch" ,0,true
      end if
      set sh = nothing
      set ts = fso.opentextfile(workfile)
      data = split(ts.readall,vbcr)
      ts.close
      set ts = nothing
      fso.deletefile workfile
      set fso = nothing
      arIPAddress = array()
      index = -1
      for n = 0 to ubound(data)
        if instr(data(n),"Default Gateway") then
          parts = split(data(n),":")
          if trim(parts(1)) <> "0.0.0.0" then
            index = index + 1
            ReDim Preserve arIPAddress(index)
            arIPAddress(index)= trim(cstr(parts(1)))
          end if
        end if
      next
      GetIPAddresses = arIPAddress
    End Function

    2008年2月2日 上午 02:03
  • Functions for Sites in Windows Server 2003

    "DFS uses site information to direct a client to the server that is hosting the requested data within the site.",所以AD的Site要切好。

    2008年2月3日 下午 07:37