wql

Query to Select All Non-Essential Temporary Files

蹲街弑〆低调 提交于 2019-12-12 02:06:37
问题 I am trying to write a script to delete unneeded temporary files. I am wanting to specifically target .tmp's, though. At least for now. So I am trying to write a WQL query to return a collection with which I can use a FOR EACH statement to delete all of the .tmp's in C:\Users\\AppData\Local\Temp. I've only recently started learning VBScript. But I have experience writing programs in C/C++ (mainly "math-y" programs). Cscript seems to have no problem with the query itself. But when I try to use

WQL syntax: DiskDriveToDiskPartition with a LIKE operator

瘦欲@ 提交于 2019-12-11 05:08:28
问题 So I'm trying to match up physical drives to partitions to drive letters, and DiskDriveToDiskPartition seems like a good candidate for doing that, but I'm struggling to get the query to work like I want it to: I've used the WMI Query Builder to create the gist of the query: ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_DiskDriveToDiskPartition WHERE Antecedent = \\\\localhost\\root\\cimv2:Win32_DiskDrive.DeviceID="\\\\\\\\.\\\

Joining two tables in WQL/SCCM

穿精又带淫゛_ 提交于 2019-12-11 02:44:05
问题 I think I'm being really stupid here. I'm using vbscript. I've connected to an SCCM server Set locator = CreateObject("WbemScripting.SWbemLocator") Set connection = locator.ConnectServer("SERVERNAME", "Root\SMS\SITENAME") I then have a WMI WQL query: Set Collections = connection.ExecQuery("SELECT LastStatusTime,AdvertisementID, LastStateName,AdvertisementName FROM SMS_ClientAdvertisementStatus INNER JOIN SMS_Advertisement ON SMS_Advertisement.AdvertisementID = SMS_ClientAdvertisementStatus

Querying access to a UNC path on a remote machine via WMI

徘徊边缘 提交于 2019-12-10 23:37:45
问题 I want to find out if the remote host has r/w access to a network share. To start out I wanted to see if I could query the target host's ability to query the UNC path for info, ala var query = string.Format("select * from CIM_Directory where name = '{0}'", path); This works fine for local files, e.g. var path = @"c:\\Windows"; However, I can't figure out an appropriate way of querying a UNC path (e.g. \\foo\bar). The query always returns a blank set. I saw a related question about executing

double backslash in WMI/WQL query powershell

半世苍凉 提交于 2019-12-10 18:06:19
问题 I am facing weird issue with my WQL query. $SCCMQuery = @' Select UAR.User, UAR.Application, UAR.CurrentState from sms_fullcollectionmembership as FCM INNER JOIN SMS_UserApplicationRequest as UAR ON UAR.User=FCM.SMSID where FCM.CollectionID="a\100104" '@ $Results = Get-WmiObject -Namespace "root\SMS\Site_Name" -Query $SCCMQuery Above query is not working properly but when i add another backslash in FCM.CollectionID like this( a\\100104 ) then it start working. Can somebody please advise me

Random value for disk Signature [closed]

烂漫一生 提交于 2019-12-08 05:46:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . As part of a machine identification system, I'm looking for the Signature of the Win32_DiskDrive. On two customer's machines now, I've seen this field have a random value. I assume that is due to not having checked the HRESULT in the shipped code. What would cause a machine to not have a valid signature? WQL

Device driver code signing for windows XP 32 bit

半腔热情 提交于 2019-12-06 15:58:06
问题 I have written a device driver for a device but each time I connect the device in windows XP 32 bit, "found new hardware" wizard appears. I am signing the driver using a Comodo code signing certificate and not using the cross certificate chain to link to microsoft root authority. Nor is the driver wql certified. So my question is to disable the found new hardware wizard on windows xp: i) Does my driver needs to be wql certified? ii) signed with microsoft root certificate using cross

VBS脚本

邮差的信 提交于 2019-12-06 06:57:34
自从安装了Oracle数据库后,我电脑的运行速度满了很多。为此我想了一个办法,让我在不需要使用Oracle数据库的时候,可以轻松地关掉Oracle相关服务。 我安装的Oracle版本为Oracle11g,与Oracle有关的服务如下图所示: 这些服务包括: 1、Oracle ORCL VSS Writer Service(手动启动) 2、OracleDBConsoleorcl(自动启动) 3、OracleJobSchedulerORCL(禁用) 4、OracleMTSRecoveryService(自动启动) 5、OracleOraDb11g_home1ClrAgent(手动) 6、OracleOraDb11g_home1TNSListener(自动启动) 7、OracleServiceORCL(自动启动) 其中,需要我们用脚本关闭的服务,都是开机自启动且当前已启动的服务,一共有四个(2、4、6、7)。 我们可以使用WQL查出这四个服务,逐一关闭即可。 VBS脚本(StopServiceLikeOracle.vbs)如下: Set ServiceSet = GetObject("winmgmts:"). _ ExecQuery("select * from Win32_Service where name like 'Oracle%' and started = true")

List of WMIEvent classes

∥☆過路亽.° 提交于 2019-12-06 01:56:38
问题 Recently I have been learning about WMI and WQL. I found out the list of Win32 classes (from MSDN) that I can query for but I am not able to find out the list of event classes (should be the subset of the list of Win32 classes isn't it ?) Does any one have a list or some kind of cheat sheet for this? I am jsut asking this out of curiosity. Example for an event class - Win32_ProcessStartTrace 回答1: Here's how to list WMI event classes in the root\cimv2 namespace with C# and System.Management :

I have a SID of a user account, and I want the SIDs of the groups it belongs to

狂风中的少年 提交于 2019-12-06 00:38:28
问题 This has to be obtained from a remote machine. The following query works not for SIDs, but for group and account names. "SELECT GroupComponent FROM Win32_GroupUser WHERE PartComponent = \"Win32_UserAccount.Domain='" + accountDomain + "',Name='" + accountName + "'\"" The Win32_Group objects it returns come in the forms of strings, and they only have domain and name (even though Win32_Group has a SID property). I have this sinking feeling I'll have to: Turn the SID into an account name by