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. 对posintion属性的简单认识,对于还在纠结的同学们,有一定的帮助

      position的四个属性值: relative ,absolute ,fixed,static 下面分别讲述这四个属性,以简单代码表示 <div id="parent" ...

  2. python基础数据类型补充

    python_day_7 一. 今日主要内容: 1. 补充基础数据类型的相关知识点 str. join() 把列表变成字符串 列表不能再循环的时候删除. 因为索引会跟着改变 字典也不能直接循环删除.把 ...

  3. TensorFlow(实战深度学习框架)----深层神经网络(第四章)

    深层神经网络可以解决部分浅层神经网络解决不了的问题. 神经网络的优化目标-----损失函数 深度学习:一类通过多层非线性变化对高复杂性数据建模算法的合集.(两个重要的特性:多层和非线性) 线性模型的最 ...

  4. php 操作 oracle lob 数据2

    CREATE SEQUENCE mylobs_id_seq    NOMINVALUE    NOMAXVALUE    NOCYCLE    CACHE 20    NOORDERINCREMENT ...

  5. Siki_Unity_2-7_Stealth秘密行动

    Unity 2-7 Stealth秘密行动 Abstract:向量运算:Animation动画:Navigation寻路系统:Mecanim动画系统 任务1&2&3:游戏介绍 & ...

  6. sprint2 团队贡献分

    团队名:在考虑 团队贡献分: 102 杨晶晶:17 106 邹育萍:18 114 纪焓:16 116 黄敏鹏:28 117 郑培轩:26 138 曾昱霖:15 最新项目的github地址: https ...

  7. lintcode-433-岛屿的个数

    433-岛屿的个数 给一个01矩阵,求不同的岛屿的个数. 0代表海,1代表岛,如果两个1相邻,那么这两个1属于同一个岛.我们只考虑上下左右为相邻. 样例 在矩阵: [ [1, 1, 0, 0, 0], ...

  8. [2017BUAA软工]第二次博客作业:代码复审

    〇.comment链接 https://github.com/hanayashiki/Sudoku/issues/1 一.代码复审 1.概要部分 (1)代码能符合需求和规格说明么? 经测试,对于合法输 ...

  9. 上传web端——个人项目

    我用visual studio新建了一个web窗口,如图: 然后这里是系统自带的代码: [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile ...

  10. CodeForces Round #527 (Div3) A. Uniform String

    http://codeforces.com/contest/1092/problem/A You are given two integers nn and kk. Your task is to c ...