The Set-WmiInstance cmdlet creates or updates an instance of an existing Windows Management
Instrumentation (WMI) class. The created or updated instance is written to the WMI repository.
New CIM cmdlets, introduced Windows PowerShell 3.0, perform the same tasks as the WMI cmdlets. The
CIM cmdlets comply with WS-Management (WSMan) standards and with the Common Information Model (CIM)
standard. this enables cmdlets to use the same techniques to manage Windows-based computers and
those running other operating systems. Instead of using Set-WmiInstance, consider using the
Set-CimInstance or
New-CimInstance cmdlets.
This command sets the WMI logging level to 2. The command passes the property to be set and the
value, together considered a value pair, in the argument parameter. The parameter takes a hash table
that's defined by the @{property = value} construction. The class information that's returned
reflects the new value.
Example 2: Create an environment variable and its value
This command creates the testvar environment variable that has the value testvalue. It does this
by creating a new instance of the Win32_Environment WMI class. This operation requires
appropriate credentials and that you may have to restart Windows PowerShell to see the new
environment variable.
Example 3: Set WMI logging level for several remote computers
This command sets the WMI logging level to 2. The command passes the property to be set and the
value, together considered a value pair, in the argument parameter. The parameter takes a hash table
that's defined by the @{property = value} construction. The returned class information reflects
the new value.
매개 변수
-Arguments
Specifies the name of the property to be changed and the new value for that property. The name and
value must be a name-value pair. The name-value pair is passed on the command line as a hash table.
For example:
Indicates that this cmdlet runs as a background job. Use this parameter to run commands that take a
long time to finish.
When you specify the AsJob parameter, the command returns an object that represents the
background job and then displays the command prompt. You can continue to work in the session while
the job finishes. If is used for a remote computer, the job is created on the local computer, and
the results from remote computers are automatically returned to the local computer. To manage the
job, use the cmdlets that contain the Job noun (the Job cmdlets). To get the job results,
use the Receive-Job cmdlet.
To use this parameter together with remote computers, the local and remote computers must be
configured for remoting. Additionally, you must start Windows PowerShell using the Run as
administrator option. For more information, see
about_Remote_Requirements.
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> identifies a valid NTLM ___domain name. To use Kerberos, specify
kerberos:<DomainName>\<ServerName>. You can't include the authority setting when you connect to
the local computer.
Specifies the name of the computer on which this cmdlet runs. The default is the local computer.
Type the NetBIOS name, an IP address, or a fully qualified ___domain name of one or more computers.
To specify the local computer, type the computer name, a dot (.), or localhost.
This parameter doesn't rely on Windows PowerShell remoting. You can use the ComputerName
parameter even if your computer isn't configured to run remote commands.
Specifies a user account that has permission to perform this action. The default is the current
user.
Type a user name, such as User01 or Domain01\User01, or enter a PSCredential object, such as
one generated by the Get-Credential cmdlet. If you type a user name, this cmdlet prompts for a
password.
This parameter isn't supported by any providers installed with parameter isn't supported by any
providers installed with Windows PowerShell.
Specifies the maximum number of concurrent connections that can be established to run this command.
This parameter is used together with the AsJob parameter. The throttle limit applies only to the
current command, not to the session or to the computer.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
입력
None
This cmdlet doesn't accept input.
출력
None
This cmdlet doesn't generate output.
참고
Windows PowerShell includes the following aliases for Set-WmiInstance: