Im writing a script to batch create AD users from an Excel File. Ive got everything working except setting the user permissions for their home directory. Im creating their home directory/share like this:
Dim ShareName, newshare
If Not FS.FolderExists(ParentDir & "\" & objuser.sAMAccountName) Then
FS.CreateFolder(ParentDir & "\" & objuser.sAMAccountName)
End If
ShareName = objuser.sAMAccountName & "$"
'On Error Resume Next
Set NewShare = ShareServiceObj.Create("fileshare", ShareName)
If Not Err Then
NewShare.Path = ParentDir & "\" & objuser.sAMAccountName
NewShare.MaxUserCount = 1 'Sets the limit for the number of user connections
NewShare.SetInfo
End If
What I cant figure out how to do is to grant the user rights to their share. I found a few references but havnt found any that i could make work yet. The ones I have found seem to be incredibly long and complex just to set share permissions. Can anybody point me in the right direction?
thanks
Dim ShareName, newshare
If Not FS.FolderExists(ParentDir & "\" & objuser.sAMAccountName) Then
FS.CreateFolder(ParentDir & "\" & objuser.sAMAccountName)
End If
ShareName = objuser.sAMAccountName & "$"
'On Error Resume Next
Set NewShare = ShareServiceObj.Create("fileshare", ShareName)
If Not Err Then
NewShare.Path = ParentDir & "\" & objuser.sAMAccountName
NewShare.MaxUserCount = 1 'Sets the limit for the number of user connections
NewShare.SetInfo
End If
What I cant figure out how to do is to grant the user rights to their share. I found a few references but havnt found any that i could make work yet. The ones I have found seem to be incredibly long and complex just to set share permissions. Can anybody point me in the right direction?
thanks