Hi,
I am trying to get the script on Reset the file permissions on homedrives - Wiki to run... I had it running before I went on holiday by changing something but can't see what I am doing wrong.. the CHOWN works but the xcacls doesn't play nicely.
Any help would be greatly appreciated as I am havign to rebuild my server
The xcacls file is in the same folder as the vbs script below and so is the chown file.
All I have done with his script is change the domain name for mine, and removed the echo lines... wish I could rememeber how I got it workign before cos it saved me hours
Any help would be greatly appreciated.
Code:' Script to change file permissions on homedrive folders ' Author: Adapted from Chris Hindmarch's code by Ric Charlton ' ------------------------------------------------------ Set FSO = CreateObject("Scripting.FileSystemObject") Set ObjShell = Wscript.CreateObject("Wscript.Shell") ShowSubfolders FSO.GetFolder("Y:\Data\FulneckSchool\Senior\HomeFolders\09\test") Sub ShowSubFolders(Folder) For Each Subfolder in Folder.SubFolders WScript.Echo "Folder = " & Subfolder userName = SubFolder.Name CMDLine1 = "cscript xcacls.vbs """ & Subfolder & """ /F /S /T /G mydomain\StaffGroup:r ""Domain admins"":f mydomain\" & userName & ":m" ObjShell.Run CMDLine1 CMDLine2 = "chown -r " & userName & " """ & Subfolder & "\*.*""" ObjShell.Run CMDLine2 Next End Sub



LinkBack URL
About LinkBacks

Reply With Quote
