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



Relevant Pages

  • Re: Setting environment variables in IIS 6.0 [PERL @INC MANIPULATION]
    ... included the sample drsaticly reduced VBS script below - the script will add ... > Only option I can think of is to write to the IIS Admin APIs using script. ... Const L_ChkCmdLibReg_ErrorMessage = "Please register the ...
    (microsoft.public.inetserver.iis)
  • Script not Functioning Properly
    ... the script is supposed to automatically reply to any new ... Const CdoPR_ACTION_FLAG = &H10810003 ... Public Sub Folder_OnMessageCreated ...
    (microsoft.public.outlook.program_vba)
  • Re: From Workgroup to Domain
    ... Ok thank you for the help - nice to see the script run:) ... it should help the win2k clients. ... Gibraltar skrev: ... Const JOIN_DOMAIN = 1 ...
    (microsoft.public.windows.server.active_directory)
  • [code] getting your script to talk to you
    ... SAPI comes as an actX object, and so is programmable using vbs. ... There was only one small script for sapi that I could find here, ... Dim oSpVoice, sText ... Const SVSF_Default = 0 ...
    (microsoft.public.scripting.vbscript)
  • Re: IF NOT Exist skip
    ... I use a function called IsConnectible, based on work by Alex Angelopoulos ... Const OpenAsDefault = -2 ... >> | a script that I run to collect inventory information. ... >> | does not handle the non existing servers very well. ...
    (microsoft.public.windows.server.scripting)