This is a multi-part message in MIME format.

------=_NextPart_000_0006_01C626CD.2EE77630
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Im trying to set the ownership of a folder to a group called SecGroup. =
If I try this code I get an error.
=20
"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.=20



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

Dim dir As DirectorySecurity =3D dinfo.GetAccessControl()

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


Please Help
Thanks
Matt
------=_NextPart_000_0006_01C626CD.2EE77630
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Im trying to set the ownership of a =
folder to a=20
group called SecGroup. If I&nbsp; try this code I get an =
error.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; </FONT>
<P><FONT face=3DArial size=3D2>"The security identifier is not allowed =
to be the=20
owner of this object"</FONT></P>
<P><FONT face=3DArial size=3D2>I can set this group to the owner via the =
gui fine.=20
</FONT></P></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>&nbsp;path =3D=20
"c:\test\"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim dinfo As =
New=20
DirectoryInfo("c:\test\")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
'Dim dir=20
As New DirectorySecurity("c:\test\", =
AccessControlSections.Owner)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim dir=20
As DirectorySecurity =3D dinfo.GetAccessControl()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dir.SetOwner(new=20
NTAccount("DOMAIN\SecGroup"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
dinfo.SetAccessControl(dir)<BR></FONT><FONT face=3DArial =
size=3D2></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Please Help</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Matt</FONT></DIV></BODY></HTML>

------=_NextPart_000_0006_01C626CD.2EE77630--