Home

NewCimInstance

NewCimInstance is a PowerShell cmdlet used to create a new instance of a CIM (Common Information Model) class on a local or remote CIM server. It is part of the CimCmdlets module and relies on the WS-Management protocol to interact with managed resources. The cmdlet supports targeting the local machine or a remote system by using -ComputerName or a CIM session (-CimSession).

To create an instance, the user specifies the CIM class with -ClassName and the namespace with -Namespace

Remote usage is common and can be achieved by supplying -ComputerName along with the other required parameters,

Example usage is typically of the form: New-CimInstance -ClassName CIM_SampleClass -Namespace root\cimv2 -Property @{ Name = 'Example'; Enabled

See also Get-CimInstance, Set-CimInstance, Remove-CimInstance, Invoke-CimMethod, and general references to CIM, WS-Man, and the CimCmdlets module.

(the
common
default
is
root\cimv2).
Property
values
for
the
new
instance
are
provided
via
-Property,
which
accepts
a
hashtable
mapping
property
names
to
values.
Not
all
CIM
classes
allow
creation;
if
the
class
does
not
support
instantiation
or
the
target
server
requires
different
methods,
the
cmdlet
may
fail
with
an
appropriate
error.
The
command
returns
the
newly
created
CIM
instance
object
when
successful.
or
by
establishing
a
persistent
CIM
session
with
-CimSession
for
reuse.
The
flexibility
of
NewCimInstance
makes
it
suitable
for
scripting
tasks
that
involve
provisioning
or
configuring
CIM-enabled
resources,
provided
the
target
class
supports
creation.
=
$true
}
-ComputerName
Server01.
In
practice,
administrators
often
use
this
cmdlet
in
conjunction
with
other
CIM
commands
to
manage
remote
systems.