wmi

How do I get the available FreeSpace from a drive from a remote computer?

心已入冬 提交于 2019-12-12 11:20:10
问题 I'm trying to get the FreeSpace from the D drive of a remote computer. Towards the end, I'm getting a ManagementException was unhandled by user code "Not Found" This is the line that gives me the error: fs = m["FreeSpace"].ToString(); Here's my code: ConnectionOptions oConn = new ConnectionOptions(); oConn.Username = "username"; oConn.Password = "password"; oConn.Authority = "ntlmdomain:XXX"; ManagementScope scope = new ManagementScope("\\\\Remote_Computer\\root\\CIMV2", oConn); scope.Connect

DisconnectedContext was detected when using ManagementObjectSearcher

大憨熊 提交于 2019-12-12 09:52:30
问题 I am using the following function within a WndProc override: Public Function GetPortName() As String Dim portNameData As String Dim comPortNumber As String Try Dim portSearcher As New ManagementObjectSearcher("\root\CIMV2", "Select Name, PNPDeviceID from Win32_PnPEntity") For Each port As System.Management.ManagementObject In portSearcher.Get() If port("Name").ToString.ToUpper.Contains("(COM") Then portNameData = port("Name").ToString comPortNumber = port("Name").ToString.Substring(port("Name

How do I remotely obtain a system's network shares and connections?

♀尐吖头ヾ 提交于 2019-12-12 09:45:58
问题 I'm looking for a way to obtain information similar to the following console applications, remotely: net use net share netstat -ano However, I need to be able to do this without running a 3rd party application on the system. This effectively rules out using psexec to execute the command remotely, because psexec would then be installed as a service. I should add that I have administrative credentials on the remote system. I've considered using WMI's remote execution ability, but that requires

Python: Using wmi to start executable remotely

吃可爱长大的小学妹 提交于 2019-12-12 09:23:16
问题 Im trying to run an executable file remotely on Windows using the wmi module. it establishes the connection but I think my process line is incorrect, as when I check the server the executable definately has not been run. Can you guys help me on the syntax with this? import wmi, time ip = '10.12.62.186' username = "administrator" password = "CLARiiON!" from socket import * print "Establishing connection to %s" %ip connection = wmi.WMI(ip, user=username, password=password) print "Connection

Get CPU temperature in python on windows

夙愿已清 提交于 2019-12-12 08:58:00
问题 Basically i want to read the cpu temperature in python. Please explain in layman's terms as i have never done this on windows before nor have i had to work with wmi. This is what I have at the moment: import wmi w = wmi.WMI(namespace="root\wmi") temperature_info = w.MSAcpi_ThermalZoneTemperature()[0] print temperature_info.CurrentTemperature (i got this code from this thread: Accessing CPU temperature in python) however, on running the script, i get this error: Traceback (most recent call

WMI Remote Process Starting

廉价感情. 提交于 2019-12-12 07:23:47
问题 Scenario I've written a WMI Wrapper that seems to be quite sufficient, however whenever I run the code to start a remote process on a server, I see the process name appear in the task manager but the process itself does not start like it should (as in, I don't see the command line log window of the process that prints out what it's doing etc.) The process I am trying to start is just a C# application executable that I have written. Below is my WMI Wrapper Code and the code I am using to start

hardware-locked licensing: which hardware pieces should i use? [duplicate]

守給你的承諾、 提交于 2019-12-12 07:18:25
问题 This question already has answers here : Is there really any way to uniquely identify any computer at all (4 answers) Closed 4 years ago . I've recently implemented a hardware-locked licensing system with fuzzy-matching to handle changes in hardware without requiring a re-activation, but i need more hardware pieces to match to be more secure / create more reliable fuzzy-matching. Right now I'm matching against the following: Physical mac address Hard-drive serial number RAM part number /

WMI query in powershell script returns no object when run in a scheduled task

拟墨画扇 提交于 2019-12-12 06:05:10
问题 I have a powershell script that runs successfully. I have tested it to death. The problem comes when running it as a scheduled task. The WMI query returns no object. I have tested with the a powershell console running under the context of the account used to run the scheduled task and it runs successfully under those conditions as well. Only when running as a scheduled task does the WMI query fail. ... Function getMSMQMessageCount($queueName) { Add-content $LogFile "Querying $queueName"

Windows Management Instrumentation msi install remote machine

我与影子孤独终老i 提交于 2019-12-12 05:58:45
问题 I'm trying to install a msi on a remote machine , i changed DCOM Config to get access from my machine when using methode install of win32_product it fails with return output 1601 ( that means that Windows Installer service could not be accessed ) i did some research in the net , and run the service manually using services.msc and did msiexec / unreg and msiexec /register , still not working ps: both machines a running on windows 10 here is my code Ps : i used the same code for win32_Bios to

On enabling Network adpater, Autoconfiguration IP address getting set

心不动则不痛 提交于 2019-12-12 05:42:12
问题 I am developing an application for Windows Vista and 7 in Visual Studio C++, in which i have to assign static IP address to a network card and establish a connection. For this, I am entering the Ip values in registry along with setting the Enable DHCP value to 0. Then i need to disable and then enable the network card for these values to take effect. For this, I am using "INetConnectionManager" in the following code: CoInitialize(0); typedef void (__stdcall * PNcFreeNetconProperties)(NETCON