ITPub博客

首页 > IT基础架构 > 网络安全 > Automatically Map Network Drives on Domain Login for All Users, Certain Users, or Certain Groups

Automatically Map Network Drives on Domain Login for All Users, Certain Users, or Certain Groups

网络安全 作者:cosy_yun 时间:2014-07-18 11:32:26 0 删除 编辑

As always, use the following instructions at your own risk (and joy). Please submit any corrections or comments if you feel so moved.

[@more@]

Automatically Map Network Drives on Domain Login for All Users, Certain Users, or Certain Groups

As always, use the following instructions at your own risk (and joy). Please submit any corrections or comments if you feel so moved.

Auto map network drives on login for all users

  1. Save the following batch file to the domain controller's NETLOGON share as logon.bat:
    @echo off
    net use * /delete /yes
    net use x: server_nameshared_directory_name
  2. Active Directory Users and Computers
  3. Right click domain name at top left and click Properties > Group Policy > Edit > User Configuration > Windows Settings > Scripts (Logon/Logoff) > Logon > Add...
  4. Enter path to logon.bat (e.g., ACME.localsysvolACME.localscriptslogon.bat) and click OK three times
  5. Login from workstation. Drive x: should appear in My Computer.

Auto map network drives on login for certain users:

  1. Save the following batch file to the domain controller's NETLOGON share as logon.bat:
    @echo off
    net use * /delete /yes
    net use x: file_server_nameshared_directory_name
  2. Active Directory Users and Computers > Users > Double click user > Profile
  3. Enter "logon.bat" (no quotes) in the "Logon script" box and click OK
  4. Login from workstation as user modified in step 2. Drive x: should appear in My Computer.

Auto map network drives on login based on Group membership

  1. Get KiXtart
  2. Put WKIX32.EXE in both the domain controller's NETLOGON share and %SystemRoot% (normally C:WINNT).
  3. Save the following script as map_drive.kx to the NETLOGON share (be sure to change the group as needed - here we've used Domain Users):
    use "*" /DELETE
    if ingroup("Domain Users")
    use x: "server_nameshare_name"
    endif
  4. Save the following batch file (which calls your KiXtart script) as login.bat to the domain controller's NETLOGON share:
    @echo off
    server_nameNETLOGONWKIX32.EXE server_nameNETLOGONmap_drive.kx
  5. Active Directory Users and Computers
  6. Right click domain name at top left and click Properties > Group Policy > Edit > User Configuration > Windows Settings > Scripts (Logon/Logoff) > Logon > Add...
  7. Enter path to login.bat (e.g., ACME.localsysvolACME.localscriptslogin.bat) and click OK three times
  8. Login from workstation as a user belonging to group designated in map_drive.kx. Drive x: should appear in My Computer.
  9. If x: does not appear, check the permissions of NETLOGON, WKIX32.EXE, your script files, etc. Also, make sure that the user or group has the necessary permissions on the shared folder you are mapping.

More KiXtart Examples

  1. Map drive if user is *not* a member of a certain group (in this case, "Students"):
    If InGroup("Students") = 0
       Use R: "serverrecords"
    EndIf
    
  2. Using Boolean operators:
    If InGroup("Teachers") Or InGroup("Office") Or InGroup("PTA")
       Use G: "serverGrownup_Files"
    EndIf
    
    If InGroup("2008 Class") And InGroup("Honors")
       Use S: "serversmart_kids"
    EndIf
    
  3. Using Select...EndSelect (stops processing on the first true Case)
    Select
       Case InGroup("Students")
          Use S: "serverstudent_storage"
       Case InGroup("Office")
          Use O: "serveroffice_docs"
          Use R: "serverrecords"
       Case InGroup("Teachers")
          Use O: "serveroffice_docs"
          Use S: "serverstudent_storage"
          Use T: "serverteaching_materials"
    EndSelect
    

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24252091/viewspace-1222032/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: Nmap用法详解
请登录后发表评论 登录
全部评论

注册时间:2014-07-18

  • 博文量
    2
  • 访问量
    5363

最新文章