Samba 3.6 & VBS скрипт

Простые/общие вопросы по UNIX системам. Спросите здесь, если вы новичок

Модераторы: vadim64, terminus

Правила форума
Убедительная просьба юзать теги [cоde] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Аватара пользователя
tray.irk
сержант
Сообщения: 266
Зарегистрирован: 2008-10-22 8:21:36
Откуда: Иркутск
Контактная информация:

Samba 3.6 & VBS скрипт

Непрочитанное сообщение tray.irk » 2012-04-23 9:04:16

Когда то сделал по статье http://www.lissyara.su/articles/freebsd ... amba+ldap/ ... Но тогда это все было на версии самбы 3.4. Сейчас решил обновиться до версии 3.6 (ввиду необходимости протокола SMB2) ... после обновления перестал работать логон скрипт написанный на VBS

Код VBS скрипта:

Код: Выделить всё

Option Explicit

Dim WSHShell, WSHNetwork, user, domain, adspath, adsobj, prop, computer

set wshNetwork = WScript.CreateObject( "WScript.Network")
set wshShell = WScript.CreateObject("WScript.Shell")

do while WSHNetwork.username = ""
WScript.Sleep 250
loop

user = wshNetwork.username
domain = wshNetwork.userdomain

adspath = "WinNT://" & domain & "/" & user
Set adsobj = GetObject(adspath)


WSHNetwork.MapNetWorkDrive "X:", "\\ldap\exchange"
WSHNetwork.MapNetWorkDrive "L:", "\\ldap\low"
WSHNetwork.MapNetWorkDrive "Q:", "\\172.16.1.100\fax"
MSgBox "Общий ресурс для приема факсов Q:\"
WSHNetwork.MapNetWorkDrive "M:", "\\ldap\media"
'MSgBox "Медиа ресурс - диск M:\"


for each prop in adsobj.groups
select case prop.name


case "asup"
WSHNetwork.MapNetWorkDrive "P:", "\\ldap\asup"
'MSgBox "Общий ресурс для отдела АСУП диск P:\"
WSHNetwork.MapNetWorkDrive "T:", "\\ldap\ta_archive"
'MSgBox "Общий ресурс для отдела АСУП диск T:\"
WSHNetwork.MapNetWorkDrive "K:", "\\ldap\distr"
'MSgBox "Общий ресурс для отдела АСУП диск K:\"


case "proizvod-metodich"
WSHNetwork.MapNetWorkDrive "P:", "\\ldap\proizvod-metodich"
'MSgBox "Общий ресурс для производственно-методического отдела диск P:\"

case "kadastr"
WSHNetwork.MapNetWorkDrive "P:", "\\ldap\kadastr"
WSHNetwork.MapNetWorkDrive "T:", "\\ldap\proizvod-metodich\TECHINCS"
'MSgBox "Общий ресурс для кадастрового отдела диск P:\"

'case "admins"
'WSHNetwork.MapNetWorkDrive "M:", "\\ldap\adm"



end select
next

Конфиг самбы:

Код: Выделить всё

#======================= Global Settings =====================================
[global]
   workgroup = obl-bti
   netbios name = ldap
   server string = Samba Server
   security = user
   max protocol = SMB2
   load printers = no
   printcap name = /dev/null
   printing = none
   disable spoolss = yes
#  guest account = nobody
   log file = /var/log/samba/log.%m
   max log size = 500
   encrypt passwords = yes
   admin users = admin
   passdb backend = ldapsam:ldap://10.239.1.101/
   ldap suffix = dc=obl-bti,dc=ru
   ldap user suffix = ou=users
   ldap group suffix = ou=groups
   ldap machine suffix = ou=computers
   ldap admin dn = "cn=root,dc=obl-bti,dc=ru"
   ldap delete dn = no
   ldap ssl = off

   winbind enum users = yes
   winbind enum groups = yes


#   socket options = SO_RCVBUF=8192 SO_SNDBUF=8192 TCP_NODELAY


   socket options=SO_RCVBUF=131072 SO_SNDBUF=131072 TCP_NODELAY
   min receivefile size=16384
   use sendfile=true
   aio read size = 16384
   aio write size = 16384
   aio write behind = true
   dns proxy = no


   local master = yes
   os level = 64
   domain master = yes
   preferred master = yes
   domain logons = yes
   logon path =
   logon home =
   wins support = yes
   dns proxy = no
   display charset = koi8-r
   unix charset = koi8-r
   dos charset = cp866


    add machine script = /usr/local/sbin/ldapaddmachine '%u' computers
    add user script = /usr/local/sbin/ldapadduser '%u' people
    add group script = /usr/local/sbin/ldapaddgroup '%g'
    add user to group script = /usr/local/sbin/ldapaddusertogroup '%u' '%g'
    delete user script = /usr/local/sbin/ldapdeleteuser '%u'
    delete group script = /usr/local/sbin/ldapdeletegroup '%g'
    delete user from group script = /usr/local/sbin/ldapdeleteuserfromgroup '%u' '%g'
    set primary group script = /usr/local/sbin/ldapsetprimarygroup '%u' '%g'
    rename user script = /usr/local/sbin/ldaprenameuser '%uold' '%unew'





#============================ Share Definitions ==============================

[netlogon]
   inherit permissions = yes
   map acl inherit = yes
   locking = no
   read only = no
   comment = Network Logon Service
   path = /usr/samba_share/netlogon/
   guest ok = yes
   writable = yes
   write list = @admins, @wheel
   admin users = @OBL-BTI\admins, OBL-BTI\d.kozlov
   share modes = no
   browseable = no
   inherit owner  = yes
   inherit acls = yes


[exchange]
        inherit permissions = yes
        map acl inherit = yes
        locking = no
        read only = no
        comment = Общая папка обмена
#       path = /usr/samba_share/exchange
        path = "/usr/samba_share/ta_arhive/Disk X"
        create mode = 777
        directory mode = 777
        public = yes
        writeable = yes
        write list = @people, @admins, @wheel
        admin users = @OBL-BTI\admins, OBL-BTI\d.kozlov
        read list = @people, @admins, @wheel

[media]
        comment = Медиа файлы
        path = /usr/samba_share/media
        create mode = 777
        directory mode = 777
        browseable = no
        public = yes
        writeable = yes
        write list = @asup, @admins, @wheel
        read list = @people, @admins, @wheel


[distr]
        comment = distr
        path = /usr/samba_share/distr
        create mode = 777
        directory mode = 777
        browseable = no
        public = yes
        writeable = yes
        write list = @admins, @wheel
        read list = @people, @admins, @wheel

[low]
        comment = low
        path = /usr/samba_share/law
        create mode = 777
        directory mode = 777
        browseable = no
        public = yes
        writeable = yes
        write list = @people, @admins, @wheel
        read list = @people, @admins, @wheel


[adm]
        comment = Административный отдел
        path = /usr/samba_share/unit/ADM
        create mode = 777
        directory mode = 777
        public = yes
        browseable = no
        writeable = yes
        write list = @econom, @kadastr, @asup, @admins, @wheel
        read list = @econom, @kadastr, @asup, @admins, @wheel

[asup]
        comment = Отдел АСУП
        path = /usr/samba_share/unit/asup
        create mode = 777
        directory mode = 777
        public = yes
        browseable = no
        writeable = yes
        write list = @asup, @admins, @wheel
        read list = @asup, @admins, @wheel

[proizvod-metodich]
        comment = Производственно-методический отдел
        path = /usr/samba_share/unit/proizvod-metodich
        create mode = 777
        directory mode = 777
        public = yes
        browseable = no
        writeable = yes
        write list = @kadastr, @proizvod-metodich, @admins, @wheel
        read list = @kadastr, @proizvod-metodich, @admins, @wheel


[kadastr]
        comment = Землеустроительный отдел
        path = /usr/samba_share/unit/kadastr
        create mode = 777
        directory mode = 777
        public = yes
        browseable = no
        writeable = yes
        write list = @kadastr, @admins, @wheel
        read list = @kadastr, @admins, @wheel


[ta_archive]
        comment = ТА
        path = /usr/samba_share/ta_arhive
        create mode = 777
        directory mode = 777
        guest ok = Yes
        public = yes
        browseable = yes
        writeable = yes
        write list = @asup, @admins, @wheel
        read list = @asup, @admins, @wheel

В итоге ругается на логон скрипт строка 16
Set adsobj = GetObject(adspath)
Числа не управляют миром, но могут показать как управляется мир

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
Alex Keda
стреляли...
Сообщения: 35182
Зарегистрирован: 2004-10-18 14:25:19
Откуда: Made in USSR
Контактная информация:

Re: Samba 3.6 & VBS скрипт

Непрочитанное сообщение Alex Keda » 2012-08-14 19:59:11

домен на самбе чтоле?
Убей их всех! Бог потом рассортирует...