472,133 Members | 1,048 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

NTAccount.Translate to SecurityIdentifier for <domain>\Administrat

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.

<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 8824
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
9 posts views Thread by bvdet | last post: by
4 posts views Thread by kovariadam | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.