Jump to content

Recommended Posts

Posted

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.

 

 
' 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...