-->
I'm looking for ideas going about unchecking the Power Management setting: 'Allow the computer to turn off this device to save power' of a bluetooth device. I was thinking about changing it in the registry but could not find where it would be located.
Gets instances of Windows Management Instrumentation (WMI) classes or information about the available classes.
Syntax
Description
Starting in PowerShell 3.0, this cmdlet has been superseded by
Get-CimInstance
.The Get-WmiObject cmdlet gets instances of WMI classes or information about the available WMIclasses. To specify a remote computer, use the ComputerName parameter.If the List parameter is specified, the cmdlet gets information about the WMI classes that areavailable in a specified namespace.If the Query parameter is specified, the cmdlet runs a WMI query language (WQL) statement.
The Get-WmiObject cmdlet does not use Windows PowerShell remoting to perform remote operations.You can use the ComputerName parameter of the Get-WmiObject cmdlet even if your computerdoes not meet the requirements for Windows PowerShell remoting or is not configured for remoting inWindows PowerShell.
Beginning in Windows PowerShell 3.0, the __Server property of the object that Get-WmiObjectreturns has a PSComputerName alias.This makes it easier to include the source computer name in output and reports.
Examples
Example 1: Get processes on the local computer
This command get the processes on the local computer.
Example 2: Gets services on a remote computer
This command gets the services on a remote computer.It uses the ComputerName parameter to specify the Internet Protocol (IP) address, 127.0.0.1.By default, the current account must be a member of the Administrators group on the remote computer.
Example 3: Get WMI classes in the root or default namespace of the local computer
This command gets the WMI classes in the root or default namespace of the local computer.
Example 4: Get a named service on multiple computers
This command gets the WinRM service on the computers that are specified by the value of theComputerName parameter.
A pipeline operator (|) sends the output to the Format-List cmdlet, which adds thePSComputerName property to the default output.This makes it easy to see the computer on which the service resides.
PSComputerName is an alias of the __Server property of the objects that Get-WmiObjectreturns. This alias is introduced in Windows PowerShell 3.0.
Example 5: Stop a service on a remote computer
This command stops the WinRM service on the Server01 remote computer.The command uses a Get-WmiObject command to get the WinRM service on Server01.Then, it invokes the StopService method of the Win32_Service WMI class on the object that theGet-WmiObject command returns.
This command is an alternative to using the Stop-Service cmdlet.
Example 6: Get the BIOS on the local computer
This command gets the BIOS on the local computer.The command uses a value of all (*) for the Property parameter of the Format-List cmdlet to displayall properties of the returned object in a list.By default, only a subset (defined in the Types.ps1xml configuration file) are displayed.
Example 7: Get the services on a remote computer
This command uses the Credential parameter of the Get-WmiObject cmdlet to get the serviceson a remote computer. The value of the Credential parameter is a user account name.The user is prompted for a password.
Parameters
Gets or sets a value that indicates whether the objects that are returned from WMI should containamended information.Typically, amended information is localizable information, such as object and property descriptions,that is attached to the WMI object.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Runs the command as a background job.Use this parameter to run commands that take a long time to finish.
When you use the AsJob parameter, the command returns an object that represents the backgroundjob and then displays the command prompt.You can continue to work in the session while the job finishes.If Get-WmiObject is used on a remote computer, the job is created on the local computer, and theresults from remote computers are automatically returned to the local computer.To manage the job, use the cmdlets that contain the Job cmdlets.To get the job results, use the Receive-Job cmdlet.
Note: To use this parameter with remote computers, the local and remote computers must be configuredfor remoting.Additionally, you must start Windows PowerShell by using the 'Run as administrator' option inWindows Vista and later versions of Windows. For more information, see about_Remote_Requirements.
For more information about Windows PowerShell background jobs, see about_Jobs andabout_Remote_Jobs.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the authentication level to be used with the WMI connection.Valid values are:
- -1: Unchanged
- 0: Default
- 1: None (No authentication in performed.)
- 2: Connect (Authentication is performed only when the client establishes a relationship with theapplication.)
- 3: Call (Authentication is performed only at the beginning of each call when the applicationreceives the request.)
- 4: Packet (Authentication is performed on all the data that is received from the client.)
- 5: PacketIntegrity (All the data that is transferred between the client and the application isauthenticated and verified.)
- 6: PacketPrivacy (The properties of the other authentication levels are used, and all the data isencrypted.)
Type: | AuthenticationLevel |
Accepted values: | Default, None, Connect, Call, Packet, PacketIntegrity, PacketPrivacy, Unchanged |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the authority to use to authenticate the WMI connection.You can specify standard NTLM or Kerberos authentication.To use NTLM, set the authority setting to ntlmdomain:<DomainName>, where <DomainName> identifiesa valid NTLM domain name. To use Kerberos, specify kerberos:<DomainName><ServerName>'.You cannot include the authority setting when you connect to the local computer.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of a WMI class.When this parameter is used, the cmdlet retrieves instances of the WMI class.
Type: | String |
Aliases: | ClassName |
Position: | 1 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the target computer for the management operation.Enter a fully qualified domain name (FQDN), a NetBIOS name, or an IP address.When the remote computer is in a different domain than the local computer, the fully qualifieddomain name is required.
The default is the local computer.To specify the local computer, such as in a list of computer names, use 'localhost', the localcomputer name, or a dot (.).
This parameter does not rely on Windows PowerShell remoting, which uses WS-Management.You can use the ComputerName parameter of Get-WmiObject even if your computer is notconfigured to run WS-Management remote commands.
Type: | String[] |
Aliases: | Cn |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a user account that has permission to perform this action.The default is the current user.Type a user name, such as 'User01', 'Domain01User01', or [email protected], enter a PSCredential object, such as an object that is returned by the Get-Credentialcmdlet. When you type a user name, you are prompted for a password.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies whether direct access to the WMI provider is requested for the specified class without anyregard to its base class or to its derived classes.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Enables all the privileges of the current user before the command makes the WMI call.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a Where clause to use as a filter.Uses the syntax of the WMI Query Language (WQL).
Important: Do not include the Where keyword in the value of the parameter.For example, the following commands return only the logical disks that have a DeviceID of 'c:'and services that have the name 'WinRM' without using the Where keyword.
Get-WmiObject Win32_LogicalDisk -filter 'DeviceID = 'c:' '
Get-WmiObject win32_service -filter 'name='WinRM'
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the impersonation level to use.
The acceptable values for this parameter are:
- 0: Default.Reads the local registry for the default impersonation level , which is usually set to '3:Impersonate'. - 1: Anonymous.Hides the credentials of the caller.
- 2: Identify.Allows objects to query the credentials of the caller.
- 3: Impersonate.Allows objects to use the credentials of the caller.
- 4: Delegate.Allows objects to permit other objects to use the credentials of the caller.
Type: | ImpersonationLevel |
Accepted values: | Default, Anonymous, Identify, Impersonate, Delegate |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Gets the names of the WMI classes in the WMI repository namespace that is specified by theNamespace parameter.
If you specify the List parameter, but not the Namespace parameter, Get-WmiObject usesthe RootCimv2 namespace by default.This cmdlet does not use the Default Namespace registry entry in theHKEY_LOCAL_MACHINESOFTWAREMicrosoftWBEMScripting registry key to determine the defaultnamespace.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the preferred locale for WMI objects.Enter a value in MS_<LCID> format.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
When used with the Class parameter, the Namespace parameter specifies the WMI repositorynamespace where the specified WMI class is located.When used with the List parameter, it specifies the namespace from which to gather WMI classinformation.
Type: | String |
Aliases: | NS |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the WMI class properties that this cmdlet gets information from.Enter the property names.
Type: | String[] |
Position: | 1 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Runs the specified WMI Query Language (WQL) statement.This parameter does not support event queries.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Searches the current namespace and all other namespaces for the class name that is specified by theClass parameter.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the maximum number of WMI operations that can be executed simultaneously.This parameter is valid only when the AsJob parameter is used in the command.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
You cannot pipe input to Get-WmiObject.
Outputs
PSObject or System.Management.Automation.RemotingJob
When you use the AsJob parameter, the cmdlet returns a job object.Otherwise, the object that Get-WmiObject returns depends on the value of the Classparameter.
Notes
- To access WMI information on a remote computer, the cmdlet must run under an account that is amember of the local administrators group on the remote computer. Or, the default access control onthe WMI namespace of the remote repository can be changed to give access rights to other accounts.Only some of the properties of each WMI class are displayed by default.The set of properties that is displayed for each WMI class is specified in the Types.ps1xmlconfiguration file.To get all properties of a WMI object, use the Get-Member or Format-List cmdlets.