My app remotely collects some info from windows machines and now I wanna try to use CimSession with DCOM protocol and Kerberos authentication instead of classic WMI commands like Get-WmiObject and etc.
I try to create a session like these:
$Cim_SessionOption = New-CimSessionOption -Protocol Dcom
$CimSession = New-CimSession -ComputerName $ComputerHost -Credential $cred -Authentication Kerberos -SessionOption $Cim_SessionOption
But it receive an error: New-CimSession : The RPC server is unavailable
Computers are domain members, the user has all needed permissions, I tried to use DNS name and IP in -ComputerName parameter.
If i just create a session without specifying an Authentication parameter all works fine:
$Cim_SessionOption = New-CimSessionOption -Protocol Dcom
$CimSession = New-CimSession -ComputerName $ComputerHost -Credential $cred -SessionOption $Cim_SessionOption
Output is:
Id : 1
Name : CimSession1
InstanceId : f8cdcbdf-377a-49d7-907e-4c909815a325
ComputerName : ComputerName
Protocol : DCOM
What is wrong with Kerberos here?