5

I want to start doing my remote LAN work using powershell, but it seems I need to run winrm quickconfig on all LAN computers before I can remotely connect to them.

How can I run that command on all computers without having to manually go to each computer to run it?

oshirowanen
  • 1,690
  • 14
  • 62
  • 79
  • 2
    Group Policy is the way. http://blogs.msdn.com/b/wmi/archive/2009/03/17/three-ways-to-configure-winrm-listeners.aspx – Zoredache Nov 09 '13 at 01:19
  • @Zoredache Why is this a comment and not an answer? I feel this is the proper answer to the question. – Jason Taylor Jan 06 '16 at 14:52
  • 1
    @JasonTaylor because on stackexchange link-only answers are generally discouraged. (links break, they aren't very useful google wise). I was being too lazy at the time to actually create an answer that described the process of using group policies to accomplish this. I was hoping someone else would take the time to follow the link and generate a useful answer. If you want some free rep you could go create an answer with a quick and dirt summary of what is on that link. – Zoredache Jan 06 '16 at 21:56

3 Answers3

4

You should look into using PSTools (specifically, PSExec) to run it. I believe you can specify a text file with computer names in it for PSExec to run through, and you can use PSexec to do a WinRM quickconfig.

neo1piv014
  • 86
  • 4
3
psexec \\PCNAMEHERE -s winrm.cmd quickconfig -q

or

psexec \\* -s winrm.cmd quickconfig -q

that "should" hit ever online pc on the network, or, export a list of PC names from AD or SCCM, then save the list as a text file and run this..

psexec @c:\temp\allpcs.txt -s winrm.cmd quickconfig -q
Russ
  • 31
  • 1
0

The only I can think of is to embed it into a login script. Even then you'd have to elevate the user rights so it can make the changes. The affected keys and services require administrator rights.

UsPeoples
  • 66
  • 3