# Windows mit expliziten Anmeldeinformationen und aktivem WinRM-HTTPS-Listener:
$ip = “172.18.32.5”
$user = “Administrator”
$pass = “Password” | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($user, $pass)
$pso = New-PSSessionOption -SkipCACheck -SkipCNCheck
Invoke-Command -ComputerName $ip -Credential $cred -Authentication Negotiate -Port 5986 -UseSSL -SessionOption $pso {
if ((Get-Item -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’).Property.Contains(‘ProductName’))
{
(Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’ -Name ‘ProductName’).ProductName
}
}
# Windows mit expliziten Anmeldeinformationen und aktivem WinRM-HTTP-Listener:
$ip = “172.18.32.5”
$user = “Administrator”
$pass = “Password” | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($user, $pass)
$pso = New-PSSessionOption -SkipCACheck -SkipCNCheck
Invoke-Command -ComputerName $ip -Credential $cred -Authentication Negotiate -Port 5985 -SessionOption $pso {
if ((Get-Item -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’).Property.Contains(‘ProductName’))
{
(Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’ -Name ‘ProductName’).ProductName
}
}
# Windows mit Anmeldeinformationen für das Dienstkonto und aktivem WinRM-HTTPS-Listener:
$ip = “172.18.32.5”
$pso = New-PSSessionOption -SkipCACheck -SkipCNCheck
Invoke-Command -ComputerName $ip -Authentication NegotiateWithImplicitCredential -Port 5986 -UseSSL -SessionOption $pso {
if ((Get-Item -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’).Property.Contains(‘ProductName’))
{
(Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’ -Name ‘ProductName’).ProductName
}
}
# Windows mit Anmeldeinformationen für das Dienstkonto und aktivem WinRM-HTTP-Listener:
$ip = “172.18.32.5”
$pso = New-PSSessionOption -SkipCACheck -SkipCNCheck
Invoke-Command -ComputerName $ip -Authentication NegotiateWithImplicitCredential -Port 5985 -SessionOption $pso {
if ((Get-Item -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’).Property.Contains(‘ProductName’))
{
(Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’ -Name ‘ProductName’).ProductName
}
}