GarethColes
MIS
Hi,
I need to develop a script/app which will find all of the computers in active directory with a name which ends in PRT01 and go through these and share a folder on each of the servers with specific access permissions.
I need to give authenticated users read, domain admins full control and remove everyone.
Finding the computers and creating the share is easy enough but I'm stuck for ideas on how to actually set the permissions.
I'm creating the shares using the following code, (I've removed a few lines about a case statement. The code originally came from share.vbs by microsoft)
Set objInstance = objService.Get("Win32_Share"
intStatus = objInstance.Create(strSharePath, strShareName, _
intShareType, null, strShareComment, null, null)
If intStatus = 0 Then
strMessage = "Succeeded in creating share " & _
strShareName & "."
Else
strMessage = "Failed to create share " & strShareName & "."
strMessage = strMessage & vbCRLF & "Status = " & _
intStatus & "."
End If
Does anyone have any suggestions about setting the permissions either using WMI or in any other way?
Regards,
Gareth
I need to develop a script/app which will find all of the computers in active directory with a name which ends in PRT01 and go through these and share a folder on each of the servers with specific access permissions.
I need to give authenticated users read, domain admins full control and remove everyone.
Finding the computers and creating the share is easy enough but I'm stuck for ideas on how to actually set the permissions.
I'm creating the shares using the following code, (I've removed a few lines about a case statement. The code originally came from share.vbs by microsoft)
Set objInstance = objService.Get("Win32_Share"
intStatus = objInstance.Create(strSharePath, strShareName, _
intShareType, null, strShareComment, null, null)
If intStatus = 0 Then
strMessage = "Succeeded in creating share " & _
strShareName & "."
Else
strMessage = "Failed to create share " & strShareName & "."
strMessage = strMessage & vbCRLF & "Status = " & _
intStatus & "."
End If
Does anyone have any suggestions about setting the permissions either using WMI or in any other way?
Regards,
Gareth