469,366 Members | 2,342 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

NTAccount.Translate to SecurityIdentifier for <domain>\Administrat

Hi!
Can anyone please explain me why following code gives an SecurityException
"System.Security.SecurityException: The name provided is not a properly
formed account name."?

-- code start --

System.Security.Principal.NTAccount ntAccount = new
System.Security.Principal.NTAccount(@"<domain>\Adm inistrators");
System.Security.Principal.SecurityIdentifier sid =
(System.Security.Principal.SecurityIdentifier)ntAc count.Translate(typeof(System.Security.Principal.S ecurityIdentifier));

-- code end --

where "<domain>" in "<domain>\Administrators" is your Active Directory Domain.

Note:
<domain>\Administrators is a built-In group. It is visible trough 'Find'
dialog in Active Directory Users and Computers Snap-In.
Feb 13 '07 #1
2 8685
please help!
Mar 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by shank | last post: by
6 posts views Thread by bobueland | last post: by
6 posts views Thread by Anders K. Olsen | last post: by
1 post views Thread by peterbe | last post: by
bvdet
9 posts views Thread by bvdet | last post: by
4 posts views Thread by kovariadam | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.