简体   繁体   中英

C# Give Permissions to Everyone in Active Directory

We want to give permissions (in .Net Application) to everyone in AD but could not find the group that contains everyone. Tried with “NT Authority\\Authenticated Users” but getting "user not found". Please provide any pointers to achieve this functionality.Below is sample code snippet.

DirectorySearcher user = new DirectorySearcher(connString);
user.Filter = String.Format("(sAMAccountName={0})", alias);
var result = user.FindOne();

Note: we can give permissions to all the users in SharePoint using “All Authenticated Users” but the same option is not working in .Net Application.

Regards, Parveen

在域中,每个人都意味着所有域用户,因此,要授予所有域用户权限,您需要使用此域:DOMAIN \\ Domain Users

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM