foler
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 1/31/2012
-
Status: offline
|
create folder structure on file server for each user...with permission if possible
Tuesday, January 31, 2012 12:42 AM
( permalink)
hello... I need to make folder structure for each user in domain. Structure is like: c:\test\barack obama c:\test\barack obama\inbox c:\test\barack obama\personal I have script which make folders for each user in active directory domain (bellow) but need to update this script to make subfolders inbox and personal. If possible, at same time to grant user permission ownership and full control to root, and for inbox share and everyone access to this share. Root folder "barack obama" without any inheritance to c:\.... script which make folders for each user in active directory domain to folder c:\test: On Error Resume Next Const ADS_SCOPE_SUBTREE = 2 Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE objCommand.CommandText = _ "SELECT displayName, sn FROM 'LDAP://DC=sk,DC=local' WHERE objectCategory='user'" Set objRecordSet = objCommand.Execute Set objFSO = CreateObject("Scripting.FileSystemObject") objRecordSet.MoveFirst Do Until objRecordSet.EOF strInitial = Left (objRecordSet.Fields("displayName").Value, 100) strFolderName = "C:\test\" & strInitial Set objFolder = objFSO.CreateFolder(strFolderName) objRecordSet.MoveNext Loop thanks
|
|
|
|
dm_4ever
-
Total Posts
:
3687
- Scores: 82
-
Reward points
:
0
- Joined: 6/29/2006
- Location: Orange County, California
-
Status: offline
|
Re:create folder structure on file server for each user...with permission if possible
Tuesday, January 31, 2012 3:25 AM
( permalink)
|
|
|
|