特权常量
SWbemPrivilegeSet.AddAsString 方法和 SWbemPrivilegeSet.Add 的 iPrivilege 参数的 strPrivilege 参数需要 WbemPrivilegeEnum 中的特权字符串。 有关如何使用特权常量的详细信息,请参阅 执行 Privileged Operations。
以下常量在 WbemPrivilegeEnum 中定义。 以下列表包括 C++ 的等效常量和用于脚本的字符串。 若要形成脚本短名称,请从 C++ 常量名称中删除“Se”和“Privilege”。
以下 VBScript 代码示例演示如何在脚本中启用 RemoteShutdown 特权。
Set Service = GetObject("winmgmts:{impersonationLevel=impersonate, (RemoteShutdown)}")
许多 WMI 方法要求启用一个或多个权限。 如果未向帐户授予权限,则无法为方法调用启用该帐户。
-
wbemPrivilegeCreateToken
-
-
1 (0x1)
-
C++ 常量: SE_CREATE_TOKEN_NAME 字符串: SeCreateTokenPrivilege
脚本短名称: CreateToken
创建主令牌对象所必需的。
-
-
wbemPrivilegePrimaryToken
-
-
2 (0x2)
-
C++ 常量: SeAssignPrimaryTokenPrivilege 字符串: SeAssignPrimaryTokenPrivilege
脚本短名称: AssignPrimaryToken
需要替换进程级令牌。
-
-
wbemPrivilegeLockMemory
-
-
3 (0x3)
-
C++ 常量: SE_LOCK_MEMORY_NAME 字符串: SeLockMemoryPrivilege
脚本短名称: LockMemory
在内存中锁定页所必需的。
-
-
wbemPrivilegeIncreaseQuota
-
-
4 (0x4)
-
C++ 常量: SE_INCREASE_QUOTA_NAME 字符串: SeIncreaseQuotaPrivilege
脚本短名称: IncreaseQuotaPrivilege
需要调整进程的内存配额。
-
-
wbemPrivilegeMachineAccount
-
-
5 (0x5)
-
C++ 常量: SE_MACINE_ACCOUNT_NAME 字符串: SeMachineAccountPrivilege
脚本短名称: MachineAccount
需要将工作站添加到域。
-
-
wbemPrivilegeTcb
-
-
6 (0x6)
-
C++ 常量: SE_TCB_NAME 字符串: SeTcbPrivilege
脚本短名称: Tcb
需要充当操作系统的一部分。 持有者是受信任的计算机基础的一部分。
-
-
wbemPrivilegeSecurity
-
-
7 (0x7)
-
C++ 常量: SE_SECURITY_NAME 字符串: SeSecurityPrivilege
编写短名称脚本: 安全性
管理审核和 NT 安全日志所必需的。
-
-
wbemPrivilegeTakeOwnership
-
-
8 (0x8)
-
C++ 常量: SE_TAKE_OWNERSHIP_NAME 字符串: SeTakeOwnershipPrivilege
脚本短名称: TakeOwnership
在 (DACL) 的任意访问控制列表中,无需访问控制项 (ACE) ,即可假定文件或其他对象的所有权。
-
-
wbemPrivilegeLoadDriver
-
-
9 (0x9)
-
C++ 常量: SE_LOAD_DRIVER 字符串: SeLoadDriverPrivilege
编写短名称脚本: LoadDriver
加载或卸载设备驱动程序所必需的。
-
-
wbemPrivilegeSystemProfile
-
-
10 (0xA)
-
C++ 常量: SE_SYSTEM_PROFILE_NAME 字符串: SeSystemProfilePrivilege
脚本短名称: SystemProfile
收集有关系统性能的配置文件信息所必需的。
-
-
wbemPrivilegeSystemtime
-
-
11 (0xB)
-
C++ 常量: SE_SYSTEMTIME_NAME字符串: SeSystemtimePrivilege
编写短名称脚本: Systemtime
更改系统时间所必需的。
-
-
wbemPrivilegeProfileSingleProcess
-
-
12 (0xC)
-
C++ 常量: SE_PROF_SINGLE_PROCESS_NAME 字符串: SeProfileSingleProcessPrivilege
脚本短名称: ProfileSingleProcess
收集单个进程的配置文件信息所必需的。
-
-
wbemPrivilegeIncreaseBasePriority
-
-
13 (0xD)
-
C++ 常量: SE_INC_BASE_PRIORITY_NAME 字符串: SeIncreaseBasePriorityPrivilege
脚本短名称: IncreaseBasePriority
需要提高计划优先级。
-
-
wbemPrivilegeCreatePagefile
-
-
14 (0xE)
-
C++ 常量: SE_CREATE_PAGEFILE_NAME 字符串: SeCreatePagefilePrivilege
脚本短名称: CreatePagefile
创建页面文件所必需的。
-
-
wbemPrivilegeCreatePermanent
-
-
15 (0xF)
-
C++ 常量: SE_CREATE_PERMANENT_NAME 字符串: SeCreatePermanentPrivilege
脚本短名称: CreatePermanent
创建永久共享对象所必需的。
-
-
wbemPrivilegeBackup
-
-
16 (0x10)
-
C++ 常量: SE_BACKUP_NAME 字符串: SeBackupPrivilege
脚本短名称: 备份
备份文件和目录需要,而不考虑为文件指定的 ACL。
-
-
wbemPrivilegeRestore
-
-
17 (0x11)
-
C++ 常量: SE_RESTORE_NAME 字符串: SeRestorePrivilege
脚本短名称: 还原
无论为文件指定的 ACL,都需要还原文件和目录。
-
-
wbemPrivilegeShutdown
-
-
18 (0x12)
-
C++ 常量: SE_SHUTDOWN_NAME 字符串: SeShutdownPrivilege
脚本短名称: 关闭
需要关闭本地系统。
-
-
wbemPrivilegeDebug
-
-
19 (0x13)
-
C++ 常量: SE_DEBUG_NAME 字符串: SeDebugPrivilege
脚本短名称: 调试
需要调试和调整另一帐户拥有的进程内存。
-
-
wbemPrivilegeAudit
-
-
20 (0x14)
-
C++ 常量: SE_AUDIT_NAME 字符串: SeAuditPrivilege
脚本短名称: 审核
在 NT 安全日志中生成审核条目所必需的。 只有安全服务器才应具有此权限。
-
-
wbemPrivilegeSystemEnvironment
-
-
21 (0x15)
-
C++ 常量: SE_SYSTEM_ENVIRONMENT_NAME 字符串: SeSystemEnvironmentPrivilege
脚本短名称: SystemEnvironment
需要修改使用此类型的内存来存储配置数据的系统的非易失 RAM。
-
-
wbemPrivilegeChangeNotify
-
-
22 (0x16)
-
C++ 常量: SE_CHANGE_NOTIFY_NAME 字符串: SeChangeNotifyPrivilege
编写短名称脚本: ChangeNotify
需要接收对文件或目录的更改通知并绕过遍历访问检查。 默认情况下,为所有用户启用此特权。
-
-
wbemPrivilegeRemoteShutdown
-
-
23 (0x17)
-
C++ 常量: SE_REMOTE_SHUTDOWN_NAME 字符串: SeRemoteShutdownPrivilege
脚本短名称: RemoteShutdown
需要关闭远程计算机。
-
-
wbemPrivilegeUndock
-
-
24 (0x18)
-
C++ 常量: SE_UNDOCK_NAME 字符串: SeUndockPrivilege
脚本短名称: 取消停靠
需要从停靠站中删除笔记本电脑。
-
-
wbemPrivilegeSyncAgent
-
-
25 (0x19)
-
C++ 常量: SE_SYNC_AGENT_NAME 字符串: SeSyncAgentPrivilege
脚本短名称: SyncAgent
同步目录服务数据所必需的。
-
-
wbemPrivilegeEnableDelegation
-
-
26 (0x1A)
-
C++ 常量: SE_ENABLE_DELEGATION_NAME 字符串: SeEnableDelegationPrivilege
脚本短名称: EnableDelegation
需要启用计算机和用户帐户才能信任委派。
-
-
wbemPrivilegeManageVolume
-
-
27 (0x1B)
-
C++ 常量: SE_MANAGE_VOLUME_NAME 字符串: SeManageVolumePrivilege
脚本短名称: ManageVolume
执行卷维护任务所必需的。
-
要求
要求 | “值” |
---|---|
最低受支持的客户端 |
Windows Vista |
最低受支持的服务器 |
Windows Server 2008 |
标头 |
|
IDL |
|