wmi

How do I use WMI to get the current OU of a computer and list all other computers in that OU?

核能气质少年 提交于 2021-02-07 19:50:03
问题 I'm using WMI and am trying to find a powershell script that will allow me get the OU of the local computer and then get a full list of computers in that OU. 回答1: Here you go: $ComputerName = '<Name of Computer>'; $Computer = Get-WmiObject -Namespace 'root\directory\ldap' -Query "Select DS_distinguishedName from DS_computer where DS_cn = '$ComputerName'"; $OU = $Computer.DS_distinguishedName.Substring($Computer.DS_distinguishedName.IndexOf('OU=')); $ComputersInOU = Get-WmiObject -Namespace

How do I use WMI to get the current OU of a computer and list all other computers in that OU?

ぐ巨炮叔叔 提交于 2021-02-07 19:47:16
问题 I'm using WMI and am trying to find a powershell script that will allow me get the OU of the local computer and then get a full list of computers in that OU. 回答1: Here you go: $ComputerName = '<Name of Computer>'; $Computer = Get-WmiObject -Namespace 'root\directory\ldap' -Query "Select DS_distinguishedName from DS_computer where DS_cn = '$ComputerName'"; $OU = $Computer.DS_distinguishedName.Substring($Computer.DS_distinguishedName.IndexOf('OU=')); $ComputersInOU = Get-WmiObject -Namespace

how to check service state using vbscript?

╄→尐↘猪︶ㄣ 提交于 2021-02-07 13:57:15
问题 Is there anyway to check the status of service using vbscript ? I would like to have a function for each possible service state : LINK Any help would be great. I did write a function for checking if service is stopped : Public Function IsServiceStop(ByVal serviceName) On Error Resume Next Dim objServices, service Set oWmiService = GetObject("winmgmts:\\.\root\cimv2") Set objServices = oWmiService.ExecQuery("Select * from Win32_Service where Name='" & serviceName & "'") For Each service In

How to set Jumbo Packet and Receive/Transmit Buffers for advanced network adapter properties in Windows?

£可爱£侵袭症+ 提交于 2021-02-07 13:43:05
问题 I am trying to set some advanced properties for Network adapter e.g. Jumbo Packet, Receive/Transmit Buffers. I tried with Win32_NetworkAdapter, Win32_NetworkConnection, Win32_NetworkAdapterConfiguration WMI classes. None of them can do that. Can anyone help me? 回答1: "Jumbo Packet" support just means a big MTU (typically 9000 bytes). Maybe the SetMTU method of the Win32_NetworkAdapterConfiguration class, or the SetIFEntry() function (see the dwMtu field). The size of the transmit and receive

How to set Jumbo Packet and Receive/Transmit Buffers for advanced network adapter properties in Windows?

若如初见. 提交于 2021-02-07 13:42:05
问题 I am trying to set some advanced properties for Network adapter e.g. Jumbo Packet, Receive/Transmit Buffers. I tried with Win32_NetworkAdapter, Win32_NetworkConnection, Win32_NetworkAdapterConfiguration WMI classes. None of them can do that. Can anyone help me? 回答1: "Jumbo Packet" support just means a big MTU (typically 9000 bytes). Maybe the SetMTU method of the Win32_NetworkAdapterConfiguration class, or the SetIFEntry() function (see the dwMtu field). The size of the transmit and receive

vbscript : getting application window text

孤街浪徒 提交于 2021-02-07 09:10:32
问题 I am automating the application installation using vbs. I have a code which launches the setup exe file and proceed further with sending the keystroks. But now I need to get the text of the installer window. I can get the title of installer window(using objShell.AppActivate ) but didn't found the way to get the text of that window. Is there any way to capture this in vbs? 回答1: An alternative could be to enumerate process command lines instead of windows: Dim WshShell Set WshShell =

vbscript : getting application window text

独自空忆成欢 提交于 2021-02-07 09:07:58
问题 I am automating the application installation using vbs. I have a code which launches the setup exe file and proceed further with sending the keystroks. But now I need to get the text of the installer window. I can get the title of installer window(using objShell.AppActivate ) but didn't found the way to get the text of that window. Is there any way to capture this in vbs? 回答1: An alternative could be to enumerate process command lines instead of windows: Dim WshShell Set WshShell =

Is a process running on a remote machine?

瘦欲@ 提交于 2021-02-06 11:33:08
问题 I have three remote PC's to which I remotely connect. I am trying to write a simple Windows application that would display in a single window whether a particular process is running on either of the machines, e.g. Server1: Chrome not running Server2: Chrome IS running Server3: Chrome IS running I used WMI and C#. So far I've got this much: ConnectionOptions connectoptions = new ConnectionOptions(); connectoptions.Username = @"domain\username"; connectoptions.Password = "password"; //IP

'proper' & reliable way to get all installed windows programs in Python?

柔情痞子 提交于 2021-02-05 20:31:38
问题 I've seen numerous ways of retrieving installed programs on WinXP+ in python. What is the proper and most robust way of doing this? Currently I'm accessing HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall and reading each of the keys from there to get a list. (I've been told this isn't the proper way of doing things) I've seen examples of using WMI/Win32com to do this as well but have seen comments along with those implementations that WMI might be turned off on certain machines

How to monitor remote Linux machines and retrieve installed software in Perl?

倾然丶 夕夏残阳落幕 提交于 2021-02-05 08:35:20
问题 I have a couple of Perl scripts that allow me to monitor remote Windows machinses through WMI. Right now I can check CPU usage, Memory usage, Disk usage and Installed Software. But what if I want to do the same job on a remote Linux machine? Ofcourse there's no WMI so I guess I shall use something similar. I have read on another old StackOverflow question that Linux exposes informations through /proc and /sys but can I query them from a remote computer? And how can I do that exactly in Perl?