SID(安全标识符)
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(安全标识符)的更多相关文章
- Windows Server 2008更改SID
参考:Windows Server 2012 克隆修改SID 前言 克隆(软克隆,硬克隆)虚拟机后,虚拟机不光名称一样,IP一样(设置静态IP情况下),连SID也一样 什么是SID SID 安全标识符 ...
- 从0开始搭建SQL Server AlwaysOn 第一篇(配置域控)
从0开始搭建SQL Server AlwaysOn 第一篇(配置域控) 第一篇http://www.cnblogs.com/lyhabc/p/4678330.html第二篇http://www.cnb ...
- (转载) 从0开始搭建SQL Server AlwaysOn 第一篇(配置域控)
安装完之后别忘了还需要安装SSMS,这是坑爹的地方之二,干嘛不集成到SQL Server安装包里还要用户自己单独下载 下载地址:https://msdn.microsoft.com/en-us/lib ...
- 安全标识符SID技术介绍及查看技巧
说到安全标识符SID就要先说说安全主体(Security Principals),安全主体是一个能够对它分配权限的对象,例如,用户.组和计算机: 对于每一个Windows 200x域中的安全主体都有一 ...
- [转]在 Windows 操作系统中的已知安全标识符(Sid security identifiers)
安全标识符 (SID) 是用于标识安全主体或安全组在 Windows 操作系统中的可变长度的唯一值.常用 Sid 的 Sid 标识普通用户的一组或通用组.跨所有操作系统,它们的值保持不变. 此信息可用 ...
- VBS脚本获取安全标识符SID(Security Identifiers)的方法
一.SID简介 SID也就是安全标识符(Security Identifiers),是标识用户.组和计算机帐户的唯一的号码.在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SI ...
- 【windows 访问控制】六、安全标识符(SID Security Identifiers)
安全标识符(SID Security Identifiers) SID是用来标识安全主体.就是给安全主体一个唯一的ID.用户层面通过用户账户名识别,程序和资源之间通过SID识别. 什么是安全标识符? ...
- 解决服务器SID引起虚拟机不能加入AD域用户,无法远程登录的问题
最近在公司搭建AD域控制器,发现无法在计算机真正添加域用户,也就是添加的用户虽然可以在本地登录,但是无法远程登录,尝试多种方法都无法解决,而最终原因居然是虚拟机导致的服务器的SID冲突.本文记录下该问 ...
- 【转】windows server 2012清除并重建SID
windows server 2012清除并重建SID 2012-09-17 17:51:51 标签:SID windows server 2012 原创作品,允许转载,转载时请务必以超链接形式标明文 ...
随机推荐
- 关于Python的装饰器(1)
Python的装饰器的概念,一直有点微妙.之前在StackOverflow上看过一篇感觉说明的很清楚的介绍: *A decorator must accept a function as an arg ...
- js显示对象所有属性和方法的函数
function ShowObjProperty2( obj ) { // 用来保存所有的属性名称和值 var attributes = '' ; var methods = '' // 开始遍历 f ...
- exe4j 使用记录(一):下载、安装及注册
一.下载 exe4j下载地址:https://www.ej-technologies.com/download/exe4j/files 进入下载页面,可以选择exe4j版本. 选择完成后,下载即可. ...
- 解析build.gradle文件
Gradle是一个非常先进的项目构建工具,它使用了一种基于Groovy的领域特定语言DSL来声明项目设置,摒弃了传统XML(如Ant和Maven)的各种繁琐配置 项目结构如上图: 1.最外层目录下的b ...
- Ryu学习总结(持续更新)
Ryu学习总结 该篇学习笔记,与其他分析Ryu控制器代码的笔记不同,主要按照程序的构成来进行分块总结,由于本人为新手入门,不能保证没有错误,如果发现错误,欢迎指教. 以下的内容主要来源: 源码 官方文 ...
- 关于 WebView 知识点的详解
什么是 WebView WebView 是手机中内置了一款高性能 webkit 内核浏览器,在 SDK 中封装的一个组件.没有提供地址栏和导航栏, WebView 只是单纯的展示一个网页界面.在开发中 ...
- Knight Moves(广搜BFS)
Description A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to ...
- FIsherman丶Team
小组成员:郝恒杰,洪佳兴,张子祥 组长:郝恒杰 项目:Fisher Job(渔夫兼职) 简介: 我们的产品渔夫兼职是为了解决大学生兼职群体 的痛苦,他们需要一个好的渠道去找一个让自己满意的兼职,但是现 ...
- HDU 5617 Jam's maze dp+滚动数组
题目链接: hdu: http://acm.hdu.edu.cn/showproblem.php?pid=5617 bc(中文):http://bestcoder.hdu.edu.cn/contest ...
- 《我是一只it小小鸟》观后感
在这个学期开始的时候我们的老师推荐给我们这本书.在很多的网站上只要一提到IT,总会有人推荐这本书,我在读这本书之前看了很多关于它的书评,其中有一位网友的一句话让我对它产生了很大的兴趣:“印象最深的是书 ...