• Narrow screen resolution
  • Wide screen resolution
  • Increase font size
  • Decrease font size
  • Default font size
  • default color
  • red color
© Diana Scherff, Amas-Veritas.com

Welcome to Amas Veritas [dot] com

Updates: Media (lyrics) has a new layout. I could never figure out how to lay it out, but it's easier to navigate now. I'm still working on a better duplicate Mamblog mod. I'm trying to make submittions easier but the poetry form died for some reason. Quizzes are also on their way from the old site. Joomla content isn't very code friendly so I'm having to rewrite old code. You can still click on News > AH v21 > Screen if you wish to use the quizzes.
 
Home arrow Tools arrow Windows PowerShell arrow Get-WmiObject [gwmi]
Get-WmiObject [gwmi] Print E-mail
Written by Diana, on 04-09-2007 02:34
Views 138    
Favoured None

PS C:\Users\Admin> help gwmi -full

NAME
    Get-WmiObject

SYNOPSIS
    Gets instances of WMI classes or information about available classes.

SYNTAX
    Get-WmiObject [-class] <string> [[-property] <string[]>] [-namespace <string>] [-computerName <string[]>] [-filter <string>] [-credential <PSCredential>] [<CommonParameters>]

    Get-WmiObject [-namespace <string>] [-computerName <string[]>] [-credential <PSCredential>] [-list] [<CommonParameters>]

    Get-WmiObject -query <string> [-namespace <string>] [-computerName <string[]>] [-credential <PSCredential>] [<CommonParameters>]


DETAILED DESCRIPTION
    Gets instances of WMI classes or information about available classes. The ComputerName parameter nan always be used to target a remote computer.  If the List parameter is specified, the cmdlet gets information about the WMI classes available in a specified namespace. If the Query parameter is specified, the cmdlet runs a WMI query language (WQL) statement.


PARAMETERS
    -class <string>
        Specifies the name of a WMI class. When this parameter is used, the cmdlet retrieves instances of the WMI class.

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -property <string[]>
        Specifies the WMI class property or set of properties to retrieve.

        Required?                    false
        Position?                    2
        Default value                *
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -namespace <string>
        When used with the Class parameter, this parameter specifies the WMI repository namespace where the referenced WMI class is located. When used with the List parameter, it specifies the namespace from which to gather WMI class information.

        Required?                    false
        Position?                    named
        Default value                Root/cimv2
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -computerName <string[]>
        Specifies the computer or computers the cmdlet will run against. The cmdlet will retrieve WMI class information and instances of WMI classes from the WMI Service (CIMOM) on the specified computers. The name of each computer can be specified as a NETBIOS name, an IP address, or a fully-qualified domain name. In addition, you can specify the local computer by using the dot (.) character.

     &nbnp;  Required?                    false
        Position?                    named
        Default value                localhost
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -filter <string>
        Specifies a where clause to use as a filter. Use the syntax of the WQL language. Do not include the where keyword in the value of the parameter.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -credential <PSCredential>
        Uses the specified credential to authenticate the user. You can type a user name or submit a credential object created by using Get-Credentia
        l. If you supply a user name, you will be prompted for a password.

        Required?                    false
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -list <SwitchParameter>
        Used to indicate that the names of the WMI classes in the WMI repository namespace specified in the Namespace parameter should be retrieved and displayed. The Default Namespace registry entry, contained in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WBEM\Scripting is not used by this cmdlet to determine the default namespace. If you specify the List parameter, but not the Namespace parameter, the root\CIMV2 namespace is used by default.

        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -query <string>
        Specifies a WMI Query Language (WQL) statement to run. Event queries are not supported.

        Required?                    true
        Position?                    named
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".


INPUT TYPE
    None


RETURN TYPE



NOTES


        For more information, type "Get-Help Get-WmiObject -detailed". For technical information, type "Get-Help Get-WmiObject -full".

        When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

        To access WMI information on a remote computer, the cmdlet must run under an account that is a member of the local administrators group on the remote computer. Alternatively, the default access control on the WMI namespace of the remote repository can be changed to give other account access rights.

        All the properties of a WMI class are not displayed by default. The set of properties that will be displayed for each WMI class is specified in the types.ps1xml configuration file. One of the examples included in this help topic demonstrates how to override this behavior by using the format-list cmdlet.


    ----------------- EXAMPLE 1 -----------------

    C:\PS>get-wmiobject win32_process


    This command displays information about all of the processes running on a computer.





    ----------------- EXAMPLE 2 -----------------

    C:\PS>get-wmiobject win32_service -computername 127.0.0.1


    This command displays information about the services on the local computer. It does so by specifying the IP address 127.0.0.1. This IP address can be changed to any other valid IP address on your network, enabling you to display information about the services on that remote computer. By default, the account you are running under must be a member of the local administrators group on the remote computer you specify for the command to succeed.




    ----------------- EXAMPLE 3 -----------------

    C:\PS>get-wmiobject -namespace "root/default" -list


    This command displays the WMI classes in the root/default namespace of the local computer.





    ----------------- EXAMPLE 4 -----------------

    C:\PS>get-wmiobject -query "select * from win32_service where name='alerter'"


    This command displays information about the Alerter service.





    ----------------- EXAMPLE 5 -----------------

    C:\PS>(get-wmiobject win32_service -filter "name='alerter'").StopService()


    This command stops the Alerter service. It calls the StopService method of the win32_service WMI class.





    ----------------- EXAMPLE 6 -----------------

    C:\PS>get-wmiobject win32_bios | format-list *


    This command displays BIOS information. It displays all of the properties of the WMI class, not just the ones specified in the types.ps1xml configuration file.





    ----------------- EXAMPLE 7 -----------------

    C:\PS>get-wmiobject win32_service -credential FABRIKAM\administrator -computer fabrikam


    This command displays service information on a computer named fabrikam. It specifies a user account name by using the Credential parameter, which causes a dialog to be displayed to gather the corresponding password.






RELATED LINKS
    Get-Credential


Last update: 04-09-2007 02:34

Published in : Tools, Windows PowerShell

Users' Comments (0) RSS feed comment

No comment posted

Add your comment



mXcomment 1.0.4 © 2007-2009 - visualclinic.fr
License Creative Commons - Some rights reserved
 
< Prev   Next >




Double click any word on this page for a definition.
Using Firefox? Enable definitions by downloading the extension.
Sorry, this feature does not currently work in Opera or Safari.

No Users Online

Statistics

OS: FreeBSD
PHP: 5.2.1
MySQL: 4.1.21-log
Time: 22:43
Caching: Disabled
GZIP: Disabled
Members: 36
News: 2448
Web Links: 39
Visitors: 1443687

Syndicate

Login

Particls