creating a SID for the Everyone group.

 DWORD SidSize;
PSID TheSID;
LPTSTR p; SidSize = SECURITY_MAX_SID_SIZE;
// Allocate enough memory for the largest possible SID.
if(!(TheSID = LocalAlloc(LMEM_FIXED, SidSize)))
{
fprintf(stderr, "Could not allocate memory.\n");
exit();
}
// Create a SID for the Everyone group on the local computer.
if(!CreateWellKnownSid(WinWorldSid, NULL, TheSID, &SidSize))
{
fprintf(stderr,
"CreateWellKnownSid Error %u",
GetLastError());
}
else
{
// Get the string version of the SID (S-1-1-0).
if(!(ConvertSidToStringSid(TheSID, &p)))
{
fprintf(stderr,
"Error during ConvertSidToStringSid.\n");
exit();
} // Use the string SID as needed.
// ... // When done, free the memory used.
LocalFree(p);
LocalFree(TheSID);
}
 typedef enum {

     WinNullSid                                  = ,
WinWorldSid = ,
WinLocalSid = ,
WinCreatorOwnerSid = ,
WinCreatorGroupSid = ,
WinCreatorOwnerServerSid = ,
WinCreatorGroupServerSid = ,
WinNtAuthoritySid = ,
WinDialupSid = ,
WinNetworkSid = ,
WinBatchSid = ,
WinInteractiveSid = ,
WinServiceSid = ,
WinAnonymousSid = ,
WinProxySid = ,
WinEnterpriseControllersSid = ,
WinSelfSid = ,
WinAuthenticatedUserSid = ,
WinRestrictedCodeSid = ,
WinTerminalServerSid = ,
WinRemoteLogonIdSid = ,
WinLogonIdsSid = ,
WinLocalSystemSid = ,
WinLocalServiceSid = ,
WinNetworkServiceSid = ,
WinBuiltinDomainSid = ,
WinBuiltinAdministratorsSid = ,
WinBuiltinUsersSid = ,
WinBuiltinGuestsSid = ,
WinBuiltinPowerUsersSid = ,
WinBuiltinAccountOperatorsSid = ,
WinBuiltinSystemOperatorsSid = ,
WinBuiltinPrintOperatorsSid = ,
WinBuiltinBackupOperatorsSid = ,
WinBuiltinReplicatorSid = ,
WinBuiltinPreWindows2000CompatibleAccessSid = ,
WinBuiltinRemoteDesktopUsersSid = ,
WinBuiltinNetworkConfigurationOperatorsSid = ,
WinAccountAdministratorSid = ,
WinAccountGuestSid = ,
WinAccountKrbtgtSid = ,
WinAccountDomainAdminsSid = ,
WinAccountDomainUsersSid = ,
WinAccountDomainGuestsSid = ,
WinAccountComputersSid = ,
WinAccountControllersSid = ,
WinAccountCertAdminsSid = ,
WinAccountSchemaAdminsSid = ,
WinAccountEnterpriseAdminsSid = ,
WinAccountPolicyAdminsSid = ,
WinAccountRasAndIasServersSid = ,
WinNTLMAuthenticationSid = ,
WinDigestAuthenticationSid = ,
WinSChannelAuthenticationSid = ,
WinThisOrganizationSid = ,
WinOtherOrganizationSid = ,
WinBuiltinIncomingForestTrustBuildersSid = ,
WinBuiltinPerfMonitoringUsersSid = ,
WinBuiltinPerfLoggingUsersSid = ,
WinBuiltinAuthorizationAccessSid = ,
WinBuiltinTerminalServerLicenseServersSid = ,
WinBuiltinDCOMUsersSid = ,
WinBuiltinIUsersSid = ,
WinIUserSid = ,
WinBuiltinCryptoOperatorsSid = ,
WinUntrustedLabelSid = ,
WinLowLabelSid = ,
WinMediumLabelSid = ,
WinHighLabelSid = ,
WinSystemLabelSid = ,
WinWriteRestrictedCodeSid = ,
WinCreatorOwnerRightsSid = ,
WinCacheablePrincipalsGroupSid = ,
WinNonCacheablePrincipalsGroupSid = ,
WinEnterpriseReadonlyControllersSid = ,
WinAccountReadonlyControllersSid = ,
WinBuiltinEventLogReadersGroup = ,
WinNewEnterpriseReadonlyControllersSid = ,
WinBuiltinCertSvcDComAccessGroup = ,
WinMediumPlusLabelSid = ,
WinLocalLogonSid = ,
WinConsoleLogonSid = ,
WinThisOrganizationCertificateSid = ,
} WELL_KNOWN_SID_TYPE;

匹配一个SID与已知的SID是否匹配

 BOOL IsWellKnownSid(
PSID pSid,
WELL_KNOWN_SID_TYPE WellKnownSidType
);

SID(安全标识符)的更多相关文章

  1. Windows Server 2008更改SID

    参考:Windows Server 2012 克隆修改SID 前言 克隆(软克隆,硬克隆)虚拟机后,虚拟机不光名称一样,IP一样(设置静态IP情况下),连SID也一样 什么是SID SID 安全标识符 ...

  2. 从0开始搭建SQL Server AlwaysOn 第一篇(配置域控)

    从0开始搭建SQL Server AlwaysOn 第一篇(配置域控) 第一篇http://www.cnblogs.com/lyhabc/p/4678330.html第二篇http://www.cnb ...

  3. (转载) 从0开始搭建SQL Server AlwaysOn 第一篇(配置域控)

    安装完之后别忘了还需要安装SSMS,这是坑爹的地方之二,干嘛不集成到SQL Server安装包里还要用户自己单独下载 下载地址:https://msdn.microsoft.com/en-us/lib ...

  4. 安全标识符SID技术介绍及查看技巧

    说到安全标识符SID就要先说说安全主体(Security Principals),安全主体是一个能够对它分配权限的对象,例如,用户.组和计算机: 对于每一个Windows 200x域中的安全主体都有一 ...

  5. [转]在 Windows 操作系统中的已知安全标识符(Sid security identifiers)

    安全标识符 (SID) 是用于标识安全主体或安全组在 Windows 操作系统中的可变长度的唯一值.常用 Sid 的 Sid 标识普通用户的一组或通用组.跨所有操作系统,它们的值保持不变. 此信息可用 ...

  6. VBS脚本获取安全标识符SID(Security Identifiers)的方法

    一.SID简介       SID也就是安全标识符(Security Identifiers),是标识用户.组和计算机帐户的唯一的号码.在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SI ...

  7. 【windows 访问控制】六、安全标识符(SID Security Identifiers)

    安全标识符(SID Security Identifiers) SID是用来标识安全主体.就是给安全主体一个唯一的ID.用户层面通过用户账户名识别,程序和资源之间通过SID识别. 什么是安全标识符? ...

  8. 解决服务器SID引起虚拟机不能加入AD域用户,无法远程登录的问题

    最近在公司搭建AD域控制器,发现无法在计算机真正添加域用户,也就是添加的用户虽然可以在本地登录,但是无法远程登录,尝试多种方法都无法解决,而最终原因居然是虚拟机导致的服务器的SID冲突.本文记录下该问 ...

  9. 【转】windows server 2012清除并重建SID

    windows server 2012清除并重建SID 2012-09-17 17:51:51 标签:SID windows server 2012 原创作品,允许转载,转载时请务必以超链接形式标明文 ...

随机推荐

  1. iOS上架被拒理由及相关解决方案记录

    注:苹果客服中国区电话:4006 701 855 最近公司上线一个电动车工具类项目,被拒无数次,今天上架了,记录一下 01 苹果拒绝理由(内购和后台定位) We noticed that your a ...

  2. 08-base镜像

    base 镜像有两层含义: 不依赖其他镜像,从 scratch 构建. 其他镜像可以之为基础进行扩展. 所以,能称作 base 镜像的通常都是各种 Linux 发行版的 Docker 镜像,比如 Ub ...

  3. JUC——JUC开发简介(一)

    前言 JUC是Java5.0开始提供的一组专门实现多线程并发处理的开发框架,利用JUC开发架构可以有效的解决实际线程项目开发之中出现的死锁.阻塞.资源访问与公平机制. 此笔记主要记录java.util ...

  4. Zookeeper-----Zookeeper概述

    一:Zookeeper的概念? ZooKeeper是一种分布式协调服务,用于管理大型主机.在分布式环境中协调和管理服务是一个复杂的过程.ZooKeeper通过其简单的架构和API解决了这个问题.Zoo ...

  5. Linux内核学习笔记(4)-- wait、waitpid、wait3 和 wait4

    进程调用 exit() 退出执行后,被设置为僵死状态,这时父进程可以通过 wait4() 系统调用查询子进程是否终结,之后再进行最后的操作,彻底删除进程所占用的内存资源. wait4() 系统调用由 ...

  6. 【RL系列】On-Policy与Off-Policy

    强化学习大致上可分为两类,一类是Markov Decision Learning,另一类是与之相对的Model Free Learning 分为这两类是站在问题描述的角度上考虑的.同样在解决方案上存在 ...

  7. mysql常用语句入门整理

    这篇属于小白入门级别,如果你已经高手可以直接跳过 1.运行数据库mysqld.exe,客户端直接mysql -uroot(root是默认用户名) -p 2 showdatabases,showtabl ...

  8. python __call__ 函数

    __call__ Python中有一个有趣的语法,只要定义类型的时候,实现__call__函数,这个类型就成为可调用的. 换句话说,我们可以把这个类型的对象当作函数来使用,相当于 重载了括号运算符. ...

  9. HDU 5170 GTY's math problem 水题

    题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5170 bc(中文):http://bestcoder.hdu.edu.cn/contests ...

  10. erlang中检查内存泄露

    最近项目内存占用过多,检查一下erlang的内存使用情况. 1. 通过etop可以很方便得出erlang内存使用的情况 spawn(fun() -> etop:start([{output, t ...