Home All Groups Group Topic Archive Search About

SetOwner The security identifier is not allowed to be the owner of this object

Author
1 Feb 2006 9:16 AM
Matt
Im trying to set the ownership of a folder to a group called SecGroup. If I  try this code I get an error.

"The security identifier is not allowed to be the owner of this object"

I can set this group to the owner via the gui fine.



path = "c:\test\"
        Dim dinfo As New DirectoryInfo("c:\test\")
        'Dim dir As New DirectorySecurity("c:\test\", AccessControlSections.Owner)

        Dim dir As DirectorySecurity = dinfo.GetAccessControl()

        dir.SetOwner(new NTAccount("DOMAIN\SecGroup"))
       dinfo.SetAccessControl(dir)


Please Help
Thanks
Matt

AddThis Social Bookmark Button