< Back

New-MrCimSession

Sat Jan 18, 2020 4:36 pm

NAME New-MrCimSession



SYNOPSIS

Creates CimSessions to remote computer(s), automatically determining if the WSMAN

or Dcom protocol should be used.





SYNTAX

New-MrCimSession [[-ComputerName] <String[]>] [[-Credential] <Object>] [<CommonParameters>]





DESCRIPTION

New-MrCimSession is a function that is designed to create CimSessions to one or more

computers, automatically determining if the default WSMAN protocol or the backwards

compatible Dcom protocol should be used. PowerShell version 3 is required on the

computer that this function is being run on, but PowerShell does not need to be

installed at all on the remote computer.





PARAMETERS

-ComputerName <String[]>

The name of the remote computer(s). This parameter accepts pipeline input. The local

computer is the default.



Required? false

Position? 1

Default value $env:COMPUTERNAME

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Credential <Object>

Specifies a user account that has permission to perform this action. The default is

the current user.



Required? false

Position? 2

Default value [System.Management.Automation.PSCredential]::Empty

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

String





OUTPUTS

Microsoft.Management.Infrastructure.CimSession





NOTES





Author: Mike F Robbins

Website: http://mikefrobbins.com

Twitter: @mikefrobbins



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



PS C:\\>New-MrCimSession -ComputerName Server01, Server02













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



PS C:\\>New-MrCimSession -ComputerName Server01, Server02 -Credential (Get-Credential)













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



PS C:\\>Get-Content -Path C:\\Servers.txt | New-MrCimSession















RELATED LINKS