PowerShell Logo Small

Set-WmiInstance



This is the built-in help made by Microsoft for the command 'Set-WmiInstance', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates or updates an instance of an existing Windows Management Instrumentation (WMI) class.

SYNTAX


Set-WmiInstance [-Class] <string> [[-Arguments] <hashtable>] [-Authentication {Default | None | Connect | Call | Packet | PacketIntegrity | Packe
tPrivacy | Unchanged}] [-Authority <string>] [-ComputerName <string[]>] [-Credential <PSCredential>] [-EnableAllPrivileges] [-Impersonation {Defa
ult | Anonymous | Identify | Impersonate | Delegate}] [-Locale <string>] [-Namespace <string>] [-AsJob] [-PutType {None | UpdateOnly | CreateOnly
| UpdateOrCreate}] [-ThrottleLimit <int>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-WmiInstance [-Authentication {Default | None | Connect | Call | Packet | PacketIntegrity | PacketPrivacy | Unchanged}] [-Authority <string>]
[-ComputerName <string[]>] [-Credential <PSCredential>] [-EnableAllPrivileges] [-Impersonation {Default | Anonymous | Identify | Impersonate | De
legate}] [-Locale <string>] [-Namespace <string>] [-AsJob] [-PutType {None | UpdateOnly | CreateOnly | UpdateOrCreate}] [-ThrottleLimit <int>] [-
Confirm] [-WhatIf] [<CommonParameters>]
Set-WmiInstance -InputObject <ManagementObject> [-Arguments <hashtable>] [-AsJob] [-PutType {None | UpdateOnly | CreateOnly | UpdateOrCreate}] [-
ThrottleLimit <int>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-WmiInstance -Path <string> [-Arguments <hashtable>] [-Authentication {Default | None | Connect | Call | Packet | PacketIntegrity | PacketPriv
acy | Unchanged}] [-Authority <string>] [-ComputerName <string[]>] [-Credential <PSCredential>] [-EnableAllPrivileges] [-Impersonation {Default |
Anonymous | Identify | Impersonate | Delegate}] [-Locale <string>] [-Namespace <string>] [-AsJob] [-PutType {None | UpdateOnly | CreateOnly | Up
dateOrCreate}] [-ThrottleLimit <int>] [-Confirm] [-WhatIf] [<CommonParameters>]
Set-WmiInstance [-Authentication {Default | None | Connect | Call | Packet | PacketIntegrity | PacketPrivacy | Unchanged}] [-Authority <string>]
[-ComputerName <string[]>] [-Credential <PSCredential>] [-EnableAllPrivileges] [-Impersonation {Default | Anonymous | Identify | Impersonate | De
legate}] [-Locale <string>] [-Namespace <string>] [-AsJob] [-PutType {None | UpdateOnly | CreateOnly | UpdateOrCreate}] [-ThrottleLimit <int>] [-
Confirm] [-WhatIf] [<CommonParameters>]
Set-WmiInstance [-Authentication {Default | None | Connect | Call | Packet | PacketIntegrity | PacketPrivacy | Unchanged}] [-Authority <string>]
[-ComputerName <string[]>] [-Credential <PSCredential>] [-EnableAllPrivileges] [-Impersonation {Default | Anonymous | Identify | Impersonate | De
legate}] [-Locale <string>] [-Namespace <string>] [-AsJob] [-PutType {None | UpdateOnly | CreateOnly | UpdateOrCreate}] [-ThrottleLimit <int>] [-
Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-WmiInstance cmdlet creates or updates an instance of an existing WMI class. The created or updated instance is written to the WMI reposit
ory.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=113402
Get-WmiObject
Invoke-WmiMethod
Remove-WmiObject
Get-WSManInstance
Invoke-WSManAction
New-WSManInstance
Remove-WSManInstance

REMARKS

<

Examples


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

C:\PS>Set-WMIInstance -class Win32_WMISetting -argument @{LoggingLevel=2}

__GENUS : 2
__CLASS : Win32_WMISetting
__SUPERCLASS : CIM_Setting
__DYNASTY : CIM_Setting
__RELPATH : Win32_WMISetting=@
__PROPERTY_COUNT : 27
__DERIVATION : {CIM_Setting}
__SERVER : SYSTEM01
__NAMESPACE : root\cimv2
__PATH : \\SYSTEM01\root\cimv2:Win32_WMISetting=@
ASPScriptDefaultNamespace : \\root\cimv2
ASPScriptEnabled : False
AutorecoverMofs : {%windir%\system32\wbem\cimwin32.mof, %windir%\system32\wbem\ncprov.mof, %windir%\syst
em32\wbem\wmipcima.mof, %windir%\system32\wbem\secrcw32.mof...}
AutoStartWin9X :
BackupInterval :
BackupLastTime :
BuildVersion : 6001.18000
Caption :
DatabaseDirectory : C:\Windows\system32\wbem\repository
DatabaseMaxSize :
Description :
EnableAnonWin9xConnections :
EnableEvents : False
EnableStartupHeapPreallocation : False
HighThresholdOnClientObjects :
HighThresholdOnEvents : 20000000
InstallationDirectory : C:\Windows\system32\wbem
LastStartupHeapPreallocation :
LoggingDirectory : C:\Windows\system32\wbem\Logs\
LoggingLevel : 2
LowThresholdOnClientObjects :
LowThresholdOnEvents : 10000000
MaxLogFileSize : 65536
MaxWaitOnClientObjects :
MaxWaitOnEvents : 2000
MofSelfInstallDirectory :
SettingID :



Description
-----------
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 a
rgument parameter. The parameter takes a hash table that is defined by the @{property = value} construction. Theclass information that is returne
d reflects the new value.








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

C:\PS>set-wmiinstance -class win32_environment -argument @{Name="testvar";VariableValue="testvalue";UserName="<SYSTEM>"}

__GENUS : 2
__CLASS : Win32_Environment
__SUPERCLASS : CIM_SystemResource
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_Environment.Name="testvar",UserName="<SYSTEM>"
__PROPERTY_COUNT : 8
__DERIVATION : {CIM_SystemResource, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER : SYSTEM01
__NAMESPACE : root\cimv2
__PATH : \\SYSTEM01\root\cimv2:Win32_Environment.Name="testvar",UserName="<SYSTEM>"
Caption : <SYSTEM>\testvar
Description : <SYSTEM>\testvar
InstallDate :
Name : testvar
Status : OK
SystemVariable : True
UserName : <SYSTEM>
VariableValue : testvalue



Description
-----------
This command creates the testvar environment variable that has the value "testvalue". It does this by creating a new instance of the Win32_Envir
onment WMI class. Note that this operation requires appropriate credentials and that you may need to restart Windows PowerShell to see the new en
vironment variable.








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

C:\PS>Set-WMIInstance -class Win32_WMISetting -argument @{LoggingLevel=2} -computername system01, system02, system03

__GENUS : 2
__CLASS : Win32_WMISetting
__SUPERCLASS : CIM_Setting
__DYNASTY : CIM_Setting
__RELPATH : Win32_WMISetting=@
__PROPERTY_COUNT : 27
__DERIVATION : {CIM_Setting}
__SERVER : SYSTEM01
__NAMESPACE : root\cimv2
__PATH : \\SYSTEM01\root\cimv2:Win32_WMISetting=@
ASPScriptDefaultNamespace : \\root\cimv2
ASPScriptEnabled : False
AutorecoverMofs : {%windir%\system32\wbem\cimwin32.mof, %windir%\system32\wbem\ncprov.mof, %windir%\syst
em32\wbem\wmipcima.mof, %windir%\system32\wbem\secrcw32.mof...}
AutoStartWin9X :
BackupInterval :
BackupLastTime :
BuildVersion : 6001.18000
Caption :
DatabaseDirectory : C:\Windows\system32\wbem\repository
DatabaseMaxSize :
Description :
EnableAnonWin9xConnections :
EnableEvents : False
EnableStartupHeapPreallocation : False
HighThresholdOnClientObjects :
HighThresholdOnEvents : 20000000
InstallationDirectory : C:\Windows\system32\wbem
LastStartupHeapPreallocation :
LoggingDirectory : C:\Windows\system32\wbem\Logs\
LoggingLevel : 2
LowThresholdOnClientObjects :
LowThresholdOnEvents : 10000000
MaxLogFileSize : 65536
MaxWaitOnClientObjects :
MaxWaitOnEvents : 2000
MofSelfInstallDirectory :
SettingID :

...



Description
-----------
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 a
rgument parameter. The parameter takes a hash table that is defined by the @{property = value} construction. The returned class information refle
cts the new value.