Home All Groups Group Topic Archive Search About

How to configure NTFS permissions on a shared folder



Author
8 Oct 2007 10:31 PM
HRS
Hello everyone,
I am hoping someone can help us add a feature to a VBscript we are currently
using. We have a VBscript that checks for new Terminal Services profiles and
if any new ones are found it copies a folder called MPS from C:\ to
M:\metaframe\profiles\%username%\Application Data. We need to modify the
script to also add the domain\domainusers group with MODIFY rights to the
NTFS permissions of the new M:\metaframe\profiles\%username%\Application
Data\MPS folder.
Any help would be greatly appreciated.
Copy of current script:

Dim fso
Dim fol
Dim fc
Dim f
dim fol_ad
Dim shellString
Dim homeFolderPath
Dim folderName
Dim objFile
dim fileName
dim append

append = 8 '--variable for OpenTextFile method
fileName = "c:\mps script\MPSscript log.txt" '--change this to the log file
path and name desired
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFile = fso.OpenTextFile(fileName, append,true)
set fol = fso.GetFolder("M:\metaframe\profiles")  'change as required
set fc = fol.SubFolders

For Each f In fc
    If (f.DateCreated > Now -1) Then
       folderName = f.path & "\Application Data\"
       fso.CopyFolder "c:\mps",folderName,true
       objFile.writeLine now & ": " & f.path
    End If
Next

Author
10 Oct 2007 1:31 AM
pooradmin
On Oct 8, 6:31 pm, HRS <H***@discussions.microsoft.com> wrote:
Show quote
> Hello everyone,
> I am hoping someone can help us add a feature to a VBscript we are currently
> using. We have a VBscript that checks for new Terminal Services profiles and
> if any new ones are found it copies a folder called MPS from C:\ to
> M:\metaframe\profiles\%username%\Application Data. We need to modify the
> script to also add the domain\domainusers group with MODIFY rights to the
> NTFS permissions of the new M:\metaframe\profiles\%username%\Application
> Data\MPS folder.
> Any help would be greatly appreciated.
> Copy of current script:
>
> Dim fso
> Dim fol
> Dim fc
> Dim f
> dim fol_ad
> Dim shellString
> Dim homeFolderPath
> Dim folderName
> Dim objFile
> dim fileName
> dim append
>
> append = 8 '--variable for OpenTextFile method
> fileName = "c:\mps script\MPSscript log.txt" '--change this to the log file
> path and name desired
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set objFile = fso.OpenTextFile(fileName, append,true)
> set fol = fso.GetFolder("M:\metaframe\profiles")  'change as required
> set fc = fol.SubFolders
>
> For Each f In fc
>     If (f.DateCreated > Now -1) Then
>            folderName = f.path & "\Application Data\"
>            fso.CopyFolder "c:\mps",folderName,true
>        objFile.writeLine now & ": " & f.path
>         End If
> Next

You can create a Wscript.Shell object to call xcacls.exe

-J
www.pooradmin.com

AddThis Social Bookmark Button