howto: vb.net set group rights to a network file
using whidbey, vb.net,
I am impersonating a domain admin
I have retrieved from AD a group called: "oci\School Reporting Authentication:
I call the following:
1) I impersonate a domain admin
2) I open a dialog box and go to the file on the win 2003 server that the Impersonated account has admin rights on
3) I call the following
-Dim userAsString ="oci\School Reporting Authentication"
Dim mSecAsNew EventWaitHandleSecurity()
Dim rule =New EventWaitHandleAccessRule(user, EventWaitHandleRights.ReadPermissions, AccessControlType.Allow)
Try
mSec.AddAccessRule(rule)
Catch exAs Security.Authentication.InvalidCredentialException
Form1.lblFilename.Text = Form1.lblFilename.Text + vbCrLf +
"exception assigning rule:" + ex.MessageEndTry
Form1.lblFilename.Text = Form1.lblFilename.Text + vbCrLf +
"Are access Rules Protected ?:" + mSec.AreAccessRulesProtected.ToString()mSec =
Nothing-
There are no errors and the new group "wont take" - nothing happens.
Question: is this approach using EventWaitHandleSecurity() correct or is there a better one?
Thanks
Support

