当前位置: 首页>>代码示例>>Python>>正文


Python _winreg.HKEY_USERS属性代码示例

本文整理汇总了Python中_winreg.HKEY_USERS属性的典型用法代码示例。如果您正苦于以下问题:Python _winreg.HKEY_USERS属性的具体用法?Python _winreg.HKEY_USERS怎么用?Python _winreg.HKEY_USERS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在_winreg的用法示例。


在下文中一共展示了_winreg.HKEY_USERS属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _user_hive

# 需要导入模块: import _winreg [as 别名]
# 或者: from _winreg import HKEY_USERS [as 别名]
def _user_hive(username=None):
    """Find the registry hive for a particular user."""
    hive_base = None
    sids = _user_sids()
    if username and username in sids:
        sid = sids[username]
        root_key = winreg.HKEY_USERS
        try:
            hive_reg = winreg.OpenKey(root_key, sid, 0, READ_ACCESS)
            if hive_reg:
                hive_base = sid
        except:
            pass
    return hive_base 
开发者ID:R-ArcGIS,项目名称:r-bridge-install,代码行数:16,代码来源:rpath.py

示例2: getUserRegistry

# 需要导入模块: import _winreg [as 别名]
# 或者: from _winreg import HKEY_USERS [as 别名]
def getUserRegistry(computerName,objRegistry,hostPath,tmpIndicators,registryList):
	print computerName + " - checking user Registry"
	
	for hive,username,userpath in registryList:
		if hive == _winreg.HKEY_LOCAL_MACHINE:
			print computerName + " - user Registry: checking logged out user (" + username + ")..."
		elif hive == _winreg.HKEY_USERS:
			print computerName + " - user Registry: checking logged in user (" + username + ")..."
		pollReg(computerName,hostPath,username,hive,userpath,objRegistry,tmpIndicators) 
开发者ID:CIS-CERT,项目名称:CIS-ESP,代码行数:11,代码来源:userRegistry.py

示例3: getLoginStatus

# 需要导入模块: import _winreg [as 别名]
# 或者: from _winreg import HKEY_USERS [as 别名]
def getLoginStatus(profile_path,profileSID,username,objRegistry):
	result,subkeys = objRegistry.EnumKey(hDefKey=_winreg.HKEY_USERS,sSubKeyName=profileSID)
	if result == 0:
		return [_winreg.HKEY_USERS,profileSID]
	else:
		return [_winreg.HKEY_LOCAL_MACHINE,username]

#works with the common types of registry keys 
开发者ID:CIS-CERT,项目名称:CIS-ESP,代码行数:10,代码来源:support.py

示例4: getShellbags

# 需要导入模块: import _winreg [as 别名]
# 或者: from _winreg import HKEY_USERS [as 别名]
def getShellbags(computerName,objRegistry,hostPath,registryList):
	print computerName + " - checking shellbags"
	userpath2 = ""
	
	for hive,username,userpath in registryList:
		outFile = open(hostPath + "\SHELLBAGS-" + username + "-" + computerName + ".csv", "w")
		outFile.write("path,created,modified,accessed\n")
		
		if hive == _winreg.HKEY_LOCAL_MACHINE:
			print computerName + " - shellbags: checking logged out user (" + username + ")..."
			userpath2 = userpath + "2"
		elif hive == _winreg.HKEY_USERS:
			print computerName + " - shellbags: checking logged in user (" + username + ")..."
			userpath2 = userpath + "\Software\Classes"
			
		keys = [userpath + "\Software\Microsoft\Windows\Shell", userpath + "\Software\Microsoft\Windows\ShellNoRoam",
			userpath2 + "\Local Settings\Software\Microsoft\Windows\Shell", userpath2 + "\Local Settings\Software\Microsoft\Windows\ShellNoRoam"]
		
		shellbags = []
		
		for key in keys:
			new_shellbags = get_shellbags(objRegistry,hive,key)
			shellbags.extend(new_shellbags)
		
		for shellbag in shellbags:
			outFile.write(support.convert_to_string(shellbag["path"]).replace(","," ") + "," + support.convert_to_string(shellbag["crtime"]) + "," + 
				support.convert_to_string(shellbag["mtime"]) + "," + support.convert_to_string(shellbag["atime"]) + "\n")
		outFile.close() 
开发者ID:CIS-CERT,项目名称:CIS-ESP,代码行数:30,代码来源:shellbags.py


注:本文中的_winreg.HKEY_USERS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。