Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   user cant write to homefolder. (http://www.go4expert.com/forums/user-write-homefolder-t23799/)

Daniel.Laursen 8Nov2010 17:59

user cant write to homefolder.
Hey guys.

we have a bit of a brainer here.

my firm is setting up a whole new network to replace the old one, and we are adding users through a VBscript and in that script we create and give permissions and all that. thats all nice, the users are created, a homefolder is created, but the permissions doesnt seem to work. if we manually go into the user setup in the AD and sets a path for the homefolder it creates it perfectly with the correct rights and all. but in the script is seems that something goes wrong cause

1. The script says: Unable to set permission for "username" BUT it does it anyway cause the user is listed in the security list with full rights, though there is another "user" called "account unknown" followed by a whole bunch of numbers.

2. when i go into a user account and run the "net use" command it finds the networkdrive and connects to the homefolder but the user cant write to the drive. he can see whats the folder contain but cant execute anything even though he owns the folder, has full rights and all. the domain administrator can read, write and delete in the very same folder but i cant find the diffrence in the security settings between the admin and the user.

This is the snip of the script. Everything else works.
I not to sure whether the parameters are correct. I've been reading through xcalcs to find the right settings and search the net endlessly to find
somebody else to do the dirty work, but I can't seem to find a script that do just this. (Most of this code is from the web though).

If I change the /E to /T I end up only with this wierd looking user, but im interested in editing the ACL instead of removing it.
If i add Administrator :F to the string, nothing happens if the /T parameter is set (strDirectory & " /T /C /G Administrator :F " &). Maybe I misunderstood something here?

strUser is always the relevant user logon name.


'Here goes
strDirectory = "\\drive\folder\..\" & strUser 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set oFSO = CreateObject("Scripting.FileSystemObject")
' Create a shell for cmd and CACLS
Set objShell = CreateObject("Wscript.Shell")

' --------------------------------------------------
' Defines permissions on folder
' --------------------------------------------------

'Assign user permission to home folder.             
intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " _
  & strDirectory & " /E /C /G " & strUser & ":F", 2, True)
Wscript.Echo "Error assigning permissions for user " _
  & strUser & " to home folder " & strDirectory
  On Error GoTo 0
 On Error GoTo 0
End If

tairjam 25Apr2011 18:41

Re: user cant write to homefolder.

Did you ever get a response to this? I'm trying something similar.

All times are GMT +5.5. The time now is 10:33.