Questions tagged [winrm]

Windows Remote Management server

Purpose of WinRM

Windows Remote Management (WinRM) is the Microsoft implementation of WS-Management Protocol, a standard Simple Object Access Protocol (SOAP)-based, firewall-friendly protocol that allows hardware and operating systems, from different vendors, to interoperate.

The WS-Management protocol specification provides a common way for systems to access and exchange management information across an IT infrastructure. WinRM and Intelligent Platform Management Interface (IPMI), along with the Event Collector are components of the Windows Hardware Management features.

Usage

You can use WinRM scripting objects, the WinRM command-line tool, or the Windows Remote Shell command line tool WinRS to obtain management data from local and remote computers that may have baseboard management controllers (BMCs). If the computer runs a Windows-based operating system version that includes WinRM, the management data is supplied by Windows Management Instrumentation (WMI).

You can also obtain hardware and system data from WS-Management protocol implementations running on operating systems other than Windows in your enterprise. WinRM establishes a session with a remote computer through the SOAP-based WS-Management protocol rather than a connection through DCOM, as WMI does. Data returned to WS-Management protocol are formatted in XML rather than in objects.

The Intelligent Platform Management Interface (IPMI) WMI provider is a standard WMI provider with classes that obtain BMC sensor data from computers with appropriate hardware. IPMI data can be accessed using the WinRM scripting API, the WMI Scripting, or COM APIs.

Basic Configuration:

First, to make WinRM work on the server we need the Windows Firewall to be enabled. Once that is done, open a command prompt and run the following command:

winrm quickconfig

This command performs configuration actions to enable this machine for remote management, which includes:

  1. Starts the WinRM service
  2. Set the WinRM service type to auto start
  3. Create a listener to accept requests on any IP address Enable
  4. firewall exception for WS-Management traffic (for http only)
551 questions
8
votes
2 answers

Create a Windows AMI with packer and ansible on AWS

I want to create an aws windows AMI with packer and ansible. I have tried many configuration, but I have still a problem of connection to the instance. Here is my packer conf : { "builders": [{ "type": "amazon-ebs", "access_key": "{{user…
elhostis
  • 1,067
  • 14
  • 32
8
votes
0 answers

How to do "first login" style things via WinRM

So I'm working on a Chef cookbook for Windows, meaning it is generally executed on a Windows Server instance (2012r2 in this case). Specifically I am installing MSYS2 which uses Cygwin under the hood. I noticed that package installs were very slow…
coderanger
  • 52,400
  • 4
  • 52
  • 75
8
votes
4 answers

Importing Scriptblock from file

I've got a working Powershell script and I'd like to have the scriptblock pulled in from an external file. Working: $scriptblock = { ... } invoke-command -ComputerName $server -ScriptBlock $Scriptblock -ArgumentList $server,$team -Credential…
kernelpanic
  • 1,158
  • 5
  • 17
  • 36
7
votes
2 answers

Increasing stack size with WinRM for ScriptMethods

We are currently refactoring our administration scripts. It had just appeared that a combination of WinRM, error handling and ScriptMethod dramatically decreases available recursion depth. See the following example: Invoke-Command -ComputerName .…
Pavel Mayorov
  • 410
  • 1
  • 11
  • 22
7
votes
2 answers

Stuck trying to bootstrap Windows server using Chef

I am a mac girl, working on connecting with knife-windows trough Opscode's managed Chef to my Rackspace Windows servers. (I know, it sounds exotic, but these Windows servers are a customer requirment). I tried to Chef for a spin but I am stuck in…
6
votes
4 answers

Powershell New-PSSession Access Denied - Administrator Account

I try to use powershell PSSession cmdlets, but I'm struggling with Access Denied Error. What I try to do is using Administrator Account I run command New-PSSession (or Enter-PSSession) and unfortunately I receive Access Denied Error. I follow all…
Piotr Czarnecki
  • 1,688
  • 3
  • 14
  • 22
6
votes
1 answer

PyWinrm Persistent PowerShell Sessions

Is anyone aware if there is a way to open a persistent PowerShell session with PyWinrm that maintains state and can be called multiple times? I'm trying to do something like the following: #!/bin/python import winrm # Initialize some COM object…
6
votes
3 answers

New-PSSession does not work locally

I am trying to connect to the localhost using New-PSSession. I have Configured WinRM using winrm quickconfig Enabled PS Remoting Enable-PSRemoting Added Trusted Host Set-Item WSMan:\localhost\Client\TrustedHosts * -Force There is an inbound…
Nida Sahar
  • 698
  • 4
  • 13
  • 29
6
votes
2 answers

running a command on a remote windows using winrm in C#

I have a simple way to connect to a remote windows machine from a local windows machine using winrm. Here is the powershell code that is working: Set-Item WSMan:\localhost\Client\TrustedHosts -Value $ip -Force $securePassword =…
max
  • 9,708
  • 15
  • 89
  • 144
6
votes
0 answers

WinRM - Second Hop without CredSSP

I would like to ask if it is possible to impersonate at "second hop" at WinRM service using only Kerberos (delegation)? CredSSP is no solution for me because I cannot prompt user password .. I'm using Windows 2008 R2, C#, .NET 4.0 ... Scenario: I…
Tomas Olejnik
  • 141
  • 1
  • 5
6
votes
4 answers

SQL Server setup fails with "Unable to generate a temporary class" when through chef-solo on vagrant

Over the past week I've been trying to address Chef COOK-1172 without much success. I'm trying to install SQL Server 2008 R2 Developer Edition (in my case) through Vagrant using the Chef-Solo provisioner. I've been able to reproduce the issue…
Sneal
  • 2,546
  • 20
  • 22
6
votes
2 answers

Remote Access with Powershell and Jenkins

I am trying to run a powershell script on a remote (Windows 2008 Server R2) machine. The following code works great when executed directly from powershell. (I.e. everything is set up correctly, WinRM services are running, Hosts trust each other,…
MadDave
  • 137
  • 1
  • 8
5
votes
1 answer

PowerShell remoting: Controlling what edition is being targeted (PowerShell Core or Windows PowerShell); the state of cross-platform remoting

This self-answered question, which focuses on Windows[1], addresses the following aspects: Now that there are two PowerShell editions - the legacy, Windows-only Windows PowerShell and the cross-platform PowerShell Core, both may be installed on a…
mklement0
  • 382,024
  • 64
  • 607
  • 775
5
votes
1 answer

PSRemotingTransportException while using WinRM - IIS Web App Deployment

I have configure the winrm. I am getting below response after running winrm quickconfig as the winrm service is already running. WinRM service is already running on this machine. WinRM is already set up for remote management on this…
5
votes
0 answers

Has anyone been able to establish a WinRM remote powershell session to a Windows Docker container?

I have two non-domain VMs. Both running the same version of PowerShell. One of the VMs is hosting a transparent-networked Docker container of WindowsServerCore. The non-Docker VM has * for the trusted machines. The Docker container has…
jermny
  • 870
  • 2
  • 12
  • 23
1
2
3
36 37