Berechtigung auf Share setzen

From: Walter (walter.weigle_at_web.de)
Date: 08/12/04


Date: Thu, 12 Aug 2004 06:58:28 -0700


>-----Originalnachricht-----
>Hi there,
>
>Wie kann man mit scriptmittel Berechtgngen auf einem
Share vergeben
>
>Thomas
>
>
>.
>
Hi,

versuchs mal mit diesem Script:

----------------------------------------------------------

'script to create file shares on several servers
' by w.wweigle.de
' version 1.0
' date: 9.08.2004
' start in a command-box with "cscript
create_file_share.vbs"

set shell = WScript.CreateObject("WScript.Shell")
Set fs = CreateObject("Scripting.FileSystemObject")

Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

DIM ShareServer, txtFile, fserv, newshare

on Error resume Next

Set TxtFile = fs.OpenTextFile("c:\temp\srvlist.txt",
ForReading, True)

Do while NOT TxtFile.AtEndofStream
        ShareServer = TxtFile.ReadLine
        Wscript.echo ShareServer
        Set fserv = GetObject("WinNT://" & ShareServer
& "/lanmanserver")
        set newshare = fserv.create("fileshare","scan")
        newshare.path = "e:\public\scan"
        newshare.description = ShareDescription
        newshare.setinfo
        newshare.MaxUserCount = -1

        'newshare = Nothing
        

loop

Txtfile.close
----------------------------------------------------------

Gruss aus Baden-Württenberg

 by www.wweigle.de