wmi

Convert WMI Creationdate in Format-Table

六眼飞鱼酱① 提交于 2020-01-06 03:36:10
问题 I'm trying to get all svchost processes from my machine into a nicely formatted table, containing a formatted datetime but so far have failed to do so. This is how I get all the processes into an array $processes = @(gwmi -cl Win32_Process -f "name='svchost.exe'") and following prints the datetime as I'd like it them but as a list $processes | % {$_.Caption, $_.ConvertToDateTime($_.CreationDate)} svchost.exe vrijdag 4 september 2015 20:47:03 svchost.exe vrijdag 4 september 2015 20:47:03

Convert WMI Creationdate in Format-Table

泄露秘密 提交于 2020-01-06 03:36:07
问题 I'm trying to get all svchost processes from my machine into a nicely formatted table, containing a formatted datetime but so far have failed to do so. This is how I get all the processes into an array $processes = @(gwmi -cl Win32_Process -f "name='svchost.exe'") and following prints the datetime as I'd like it them but as a list $processes | % {$_.Caption, $_.ConvertToDateTime($_.CreationDate)} svchost.exe vrijdag 4 september 2015 20:47:03 svchost.exe vrijdag 4 september 2015 20:47:03

Why is WmiPrvSE.exe holding onto a handle to my Process' Job Object?

心不动则不痛 提交于 2020-01-06 03:00:07
问题 I have a .NET application which spawns multiple child 'worker processes'. I am using the Windows Job Object API and the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE setting to ensure the child processes always get killed if the parent process is terminated. However, I have observed a number of orphaned processes still running on the machine after the parent has been closed. Using Process Explorer, I can see they are correctly still assigned to the Job, and that the Job has the correct 'Kill on Job

Netstat with WMI and VBScript

℡╲_俬逩灬. 提交于 2020-01-06 02:12:12
问题 I am working on a project where I need to modify a script used for network documentation. The current script that we use is a modified version of SYDI, found here. What I would like to do is add to this script the ability to execute a netstat -an and have it returned with the rest of the report. I was curious if anyone has used WMI and VBScript to return netstat information and how it might be able to be incorporated into this script. NOTE: I am not trying to promote a product and I am not

Find out if a process finished running

空扰寡人 提交于 2020-01-05 23:41:33
问题 I have a server which receives commands from a client and runs them. These commands use one specific batch script, which receives arguments and runs. The script calls an external console application program with these arguments. The arguments can also instruct the script to run multiple instances of the console application, in the background. So, the outcome could be one open CMD , running 3 instances of app.exe , in the background. I wish to know when each one of those processes of app.exe

WMI Files Montioring using C#

主宰稳场 提交于 2020-01-05 12:16:25
问题 I am working on WMI(Windows Management Instrumentation) in C# and stuck at a point. I have to create an application using WMI (C#) similar to File System Watcher. I would like to get notified every time whenever within a particular folder a new file is created or deleted. MY WQL query is : SELECT * from _InstanceModificationEvent within 2 where TargetInstance ISA 'CIM_DataFile' and TargetInstance.Drive = 'C:' AND TargetInstance.Path='\\Test' While running the query using wbemtest , it

Using WMI to get printer logs

夙愿已清 提交于 2020-01-05 05:34:11
问题 I'm trying to use WMI to get printer system logs from several servers. A week ago I made the following code which for some reason only works sometimes: wmic /node:<servername> NTEvent WHERE "logfile='System' AND SourceName='Print' AND TimeGenerated > '20130219'" get EventCode,TimeGenerated,Message This line of code sometimes will work, but the majority of the time I'm getting the following error whenever I've tried running it to get logs: ERROR: Code = 0x80020009 Description = Exception

get-wmiobject to pull logs using Win32_NTLogEvent

倖福魔咒の 提交于 2020-01-05 04:56:17
问题 I have to use get-wmiobject to pull logs off of a remote server. WinEvent doesn't work with 2003 servers and I'm getting blocked using eventlog. When I run the following command in powershell it works just fine, but when I send the output to a file I get completely different results and I'm not sure why? Get-WmiObject -computername $server -query "SELECT * FROM Win32_NTLogEvent WHERE (logfile='system') AND (EventCode='19') AND (TimeWritten>'$begindate')") The output in powershell: Category :

WMI __InstanceModificationEvent filtering

一世执手 提交于 2020-01-05 03:36:18
问题 We are designing a monitoring solution for our system, and we're looking into WMI as a possible option. In short, we want to create a generic system where it shall be possible to subscribe to multiple changes in WMI data instances. We're looking into the __InstanceModificationEvent to do this: The following prototype code monitors all changes on any instance of notepad: void StartMonitor() { var query = "SELECT * " + "FROM __InstanceModificationEvent " + "WITHIN 1 " + "WHERE TargetInstance

Microsoft.Web.Administration: System.UnauthorizedAccessException

徘徊边缘 提交于 2020-01-04 14:09:13
问题 I use the Windows.Web.Administration dll in a C# program to manage IIS 7 (I use only the method Recycle ). The first problem was: System.UnauthorizedAccessException: Filename: redirection.config Error: Cannot read configuration file due to insufficient permissions And later I have added NETWORK SERVICE with full control at the folder C:\Windows\System32\inetsrv ". Now I have this message error: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E