Woody May 25, 1:19 pm show options
Newsgroups: microsoft.public.scripting.vbscript
From: "Woody" <TOSCA...@YAHOO.CO.UK> - Find messages by this author
Date: 25 May 2005 05:19:54 -0700
Local: Wed,May 25 2005 1:19 pm
Subject: Re: Create folder structure inside current folder.
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

I am going to be cheeky now and ask if you can help me with this script
dilema i have before i create another post in the group.
I am using this script below to create the permissions on the users
Home Area which gives them Full Control, Administrator Full Control and
Staff Modify.

What i want to be able to do with a new script is only give read access
to the root of the pupils home directory but full control of the
folders (and subfolders which they will be able to create themselves)
of the folder structure i have created for them.

I currently use this.

Const ForAppending = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("c:\sec.bat", ForAppending,
True)

REM
********************************************************************************
Set objOU = GetObject ("LDAP://ou=ENTRY 97,OU=PUPILS,DC=LIB,=UK")
REM
********************************************************************************

For each objuser in objOU

REM
********************************************************************************
commandtorun = "CACLS
"&chr(34)&"D:\HOMEDIRS\entry97\"&objUser.SAMAccountName&chr(34)&" /T /C
/P "&chr(34)&objUser.SAMAccountName&chr(34)&":F administrator:F
STAFFG:C <c:\y.txt"
REM
********************************************************************************

Set WshShell = CreateObject("WScript.Shell")
REM WshShell.Run commandtorun, 1, TRUE

objTextFile.WriteLine(commandtorun)
objTextFile.WriteLine(attribcommand)

REM This will make the account not expire DO NOT USE IF WANT USER TO
CHANGE PASSWORD WHEN LOG ON

Next
objTextFile.Close

REM RUN VBS FILE
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\sec.bat", 1, TRUE
REM objFSO.DeleteFile("C:\sec.bat")
Wscript.Echo "User Security has been set"