![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Running WMI Query in without Powershell or VBS Hi, is it possible to call a windows API to get the wmi information? Some of the computers in my company do not have PowerShell on them so we need to come up with a better way. Also, can these queries be run in cmd.exe? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Running WMI Query in without Powershell or VBS You don't need powershell to remotely query wmi user the -computername parameter for get-wmiobject PS> get-wmiobject Win32_Services -computername server1 You can also use wmic http://www.microsoft.com/resources/d...n-us/wmic.mspx "greatbarrier86" <greatbarrier86@discussions.microsoft.com> wrote in message news:36F1E9D2-53BA-4D10-B1DB-C8F02F9DE779@microsoft.com... > Hi, > > is it possible to call a windows API to get the wmi information? Some of > the > computers in my company do not have PowerShell on them so we need to come > up > with a better way. Also, can these queries be run in cmd.exe? |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Running WMI Query in without Powershell or VBS wmic might be what i need. The thing is, we are going to be running these queries directly on the machine that is being queried. Thus, i think using get-wmiobject wont work. "Brandon Shell" wrote: > You don't need powershell to remotely query wmi > user the -computername parameter for get-wmiobject > PS> get-wmiobject Win32_Services -computername server1 > > You can also use wmic > http://www.microsoft.com/resources/d...n-us/wmic.mspx > > "greatbarrier86" <greatbarrier86@discussions.microsoft.com> wrote in message > news:36F1E9D2-53BA-4D10-B1DB-C8F02F9DE779@microsoft.com... > > Hi, > > > > is it possible to call a windows API to get the wmi information? Some of > > the > > computers in my company do not have PowerShell on them so we need to come > > up > > with a better way. Also, can these queries be run in cmd.exe? > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Running WMI Query in without Powershell or VBS using wmic works, but it outputs more than i actually want. if i do the following %PC_Model% = Wmic path win32_computersystem get model it returns a header and the pc model. Since i want to write the model to a file, is there a way to just spit back the model and not the header? "greatbarrier86" wrote: > wmic might be what i need. > > The thing is, we are going to be running these queries directly on the > machine that is being queried. Thus, i think using get-wmiobject wont work. > > "Brandon Shell" wrote: > > > You don't need powershell to remotely query wmi > > user the -computername parameter for get-wmiobject > > PS> get-wmiobject Win32_Services -computername server1 > > > > You can also use wmic > > http://www.microsoft.com/resources/d...n-us/wmic.mspx > > > > "greatbarrier86" <greatbarrier86@discussions.microsoft.com> wrote in message > > news:36F1E9D2-53BA-4D10-B1DB-C8F02F9DE779@microsoft.com... > > > Hi, > > > > > > is it possible to call a windows API to get the wmi information? Some of > > > the > > > computers in my company do not have PowerShell on them so we need to come > > > up > > > with a better way. Also, can these queries be run in cmd.exe? > > > > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Running WMI Query in without Powershell or VBS You can run PowerShell based WMI queries against a remote machine. PowerShell does not need to be on the remote machine -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "greatbarrier86" wrote: > wmic might be what i need. > > The thing is, we are going to be running these queries directly on the > machine that is being queried. Thus, i think using get-wmiobject wont work. > > "Brandon Shell" wrote: > > > You don't need powershell to remotely query wmi > > user the -computername parameter for get-wmiobject > > PS> get-wmiobject Win32_Services -computername server1 > > > > You can also use wmic > > http://www.microsoft.com/resources/d...n-us/wmic.mspx > > > > "greatbarrier86" <greatbarrier86@discussions.microsoft.com> wrote in message > > news:36F1E9D2-53BA-4D10-B1DB-C8F02F9DE779@microsoft.com... > > > Hi, > > > > > > is it possible to call a windows API to get the wmi information? Some of > > > the > > > computers in my company do not have PowerShell on them so we need to come > > > up > > > with a better way. Also, can these queries be run in cmd.exe? > > > > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Running WMI Query in without Powershell or VBS Standard PowerShell cmdlets do not have built-in remote capability. Using the Get-WmiObject is the exception and as long as the application has a WMI provider, such as Exchange Server 2003, you can remotely access it from your administrative workstation with PowerShell (target remote system does not need to have Powershell or .NETFramework). For an example and more, see http://www.leedesmond.com/weblog/?p=177. HTH. -- http://www.leedesmond.com/weblog/ "greatbarrier86" wrote: > using wmic works, but it outputs more than i actually want. if i do the > following > %PC_Model% = Wmic path win32_computersystem get model > it returns a header and the pc model. Since i want to write the model to a > file, is there a way to just spit back the model and not the header? > > "greatbarrier86" wrote: > > > wmic might be what i need. > > > > The thing is, we are going to be running these queries directly on the > > machine that is being queried. Thus, i think using get-wmiobject wont work. > > > > "Brandon Shell" wrote: > > > > > You don't need powershell to remotely query wmi > > > user the -computername parameter for get-wmiobject > > > PS> get-wmiobject Win32_Services -computername server1 > > > > > > You can also use wmic > > > http://www.microsoft.com/resources/d...n-us/wmic.mspx > > > > > > "greatbarrier86" <greatbarrier86@discussions.microsoft.com> wrote in message > > > news:36F1E9D2-53BA-4D10-B1DB-C8F02F9DE779@microsoft.com... > > > > Hi, > > > > > > > > is it possible to call a windows API to get the wmi information? Some of > > > > the > > > > computers in my company do not have PowerShell on them so we need to come > > > > up > > > > with a better way. Also, can these queries be run in cmd.exe? > > > > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Is there a way to query DNS from powershell? | PowerShell | |||
| VBScript problem in running Stored Query | VB Script | |||
| LDS query via powershell | PowerShell | |||
| PerfMon PowerShell Query | PowerShell | |||
| Query NT4 Domain from Powershell | PowerShell | |||