Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

14

Adding the parameter -quiet to the quickconfig call will suppress the yes/no prompt, and do what you want. winrm quickconfig -quiet


12

Use Group Policy: Computer > Policies > Administrative Templates > Windows Components > Windows Remote Management > WinRM Service: Disallow Negotiate Authentication: Disabled.


10

Open a PowerShell window with administrative privileges. Run dir WSMan:\localhost\listener\*\Port and check the Value parameter to see what you're currently listening on. If you'd like to change it, run Set-Item WSMan:\localhost\listener\*\Port 8888 If you'd still like to do it with winrm, you need to modify your command to the following -- winrm set winrm/...


6

You just cannot do it mate, be cause MS doesn't allow you to do it via WUApi. Details can be found here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa387288(v=vs.85).aspx You can try to use Scheduled task to get this done.


6

This might sound like kind of a weird answer, but... There's a PowerShell script for checking to see if there are available updates for Nagios. You could probably use this script or a variant for your purposes, without Nagios. As for whether they're in progress, check for whether or not Wuauclt and TrustedInstaller are running. Microsoft's advice about ...


5

"When the road before you splits in two, take a third path..." ~ Telaxian Proverb Script This is the script I used to get the SMART data from multiple machines. I've already enabled winrm on the devices used in this example. $aComputers = Get-Content C:\ComputerSMARTDriveTest.txt (Get-WmiObject -ComputerName $aComputers -namespace root\wmi –class ...


5

I've made recently HTTPS + WINRM and got exactly the same problems. The solution is - before invoking command winrm quickconfig -transport:https you must do some prerequisite job. to be more specific you must install on the server certificate. you can look how to do that here - http://blogs.technet.com/b/jhoward/archive/2005/02/02/365323.aspx to make ...


5

Unfortunately, you cannot perform this task using the Set-NetFirewallRule cmdlet, as the WMI calls to enable the Firewall cmdlets are only available in 2012+. For Windows Server 2008, you can use netsh advfirewall. Example: netsh advfirewall firewall add rule name="Name" dir=in action=allow remoteip=any You can still use PowerShell to run this command on ...


4

As Joeqwerty said, it's usually accepted that you're going to be using NTLM auth with an external trust, and Kerberos with a forest trust. However, it is possible to get Kerberos authentication working with an external domain, but there are conditions. The trust has to be created using the fully qualified domain name (FQDN). Kerberos referral fails if the ...


4

To explain it a little more, if you have executed Get-ADComputer then you will get possibly an array of objects or a single object back. I assume you are calling something like the following: $serverList = Get-ADComputer -LDAPFilter '(cn=*DC*)'; This would get all the computers with DC in their name. Because you potentially have an array (more then one) ...


4

What works is winrm configSDDL default And then allowing read and execute rights. But strange thing, that settings there are the same as in WSMan:\localhost\Service\RootSDDL. It could be because of winrm configSDDL reloads some cache or something, I dunno...


3

The Web Services Management Protocol Extensions for Windows Vista protocol documentation is what you're looking for if you really want to use your own code in place of WinRM. It looks like a non-trivial protocol to implement.


3

Well, I feel a little ashamed, but I figured out what I was doing wrong. Basically, I needed to add the -Wait param to the Start-Process cmdlet. Final code looks like this: function InstallCU { Write-Host "Installing June 2013 CU..." Invoke-Command -ComputerName $ServerName -ScriptBlock { Start-Process "c:\aaa\prjcusp2\ubersrvprj2010-...


3

Edit the registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Client. Set auth_kerberos and auth_negotiate to 1. Restart the service.


3

If command line is your choise, PsExec seems to be the solution, but for mission critical tasks I wouldn't recommend it. The reason is the following: PsExec has problems with multiple runs. I prefer to use API for such purposes. WMI will do the job as it is described here (my favourite solution). Alternatively you can use ServerManager API. It allows to ...


3

The Windows Update API is special. It specifically checks for and disallows remote access by checking if your token is marked as remote. I don't know why it was written this way. I ended up creating a scheduled task and invoking the windows update API inside that - quite a nuisance.


3

Try the slightly less quick way:


3

Each Windows update patch will write several events in the Setup event log. Event ID 1 - Initiating changes for package KB#### Event ID 4 - A reboot is necessary before package KB#### can be changed to installed state Event ID 2 - Package KB#### was successfully changed to the Installed state One way to determine all patches had been applied would be to ...


2

WinRM is not very friendly. You can browse the settings easily enough: http://technet.microsoft.com/en-us/library/cc782312%28WS.10%29.aspx That describes some of the details, but winrm get wsman:microsoft.com/wsman/2005/06/config -format:#xml will dump out an XML-formatted file for you to use. Unfortunately, you can't put the whole file. That would be ...


2

You can get some insight into Powershell/WS-Man sessions by using this command: Get-WSManInstance -ConnectionURI http://myserver.contoso.com:5985/wsman shell -Enumerate This command can be run locally or on the remote server. myserver.contoso.com represents the remote server all of your clients are connecting to. You'll see information on about each open ...


2

Kerberos will be selected by default in an AD domain. But if anything goes wrong, then the client will not be able to fall back to any of the other authentication mechanisms. For instance, if the SPN for the service is not registered, Kerberos cannot be used, and the WinRM connection will fail. You also won't be able to use WinRM in other situations where ...


2

Does the user account in your PSCredential object belong to the administrators group of the target machine? Did you run winrm quickconfig on the new machine in an elevated command prompt? It should start the winrm service and create a winrm listener on tcp port 5985 with the corresponding firewall exception. You can then try to run winrs -r:http://<...


2

Check your http.sys: netsh http show iplist to confirm that you are listening on the loopback address. if not, add 127.0.0.1 to the list of listeners.


2

It turns out that the SQL Server doesn't have SSL certificates installed, so I can't use SSL. Instead, I use HTTP and made sure to mark the server as a Trusted Host on the client using the following setting (although a server IP instead of * would work). winrm set winrm/config/client @{TrustedHosts="*"}


2

You would normally use the Set-WSManQuickConfig -UseSSL command to configure the SSL certificate on the WinRM service. Alternatively, you can manually use Set-Item to configure the thumbprint on the WinRM service. See below for an example. Set-Location -Path WSMan:\localhost\Service; Set-Item -Path .\CertificateThumbprint -Value 'THUMBPRINT'; NOTE: Make ...


2

I have recently put together a short script in order to do the same thing you are trying to accomplish, here are the relevant parts. Be aware that you will get an error at the end as the Invoke-Command is going to reset the WinRM service while you are waiting for the result of the Restart-Service command... $yourCred = Get-Credential domain\account $...


2

Can you add the User using: winrm configSDDL http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd Source


2

I'm not sure if this is likely to make a difference, but the SubscriptionManager value in my GPO is set to Server=http://server.foo.com:5985/wsman/SubscriptionManager/WEC. Apparently I felt it necessary to provide the full URL even though it explicitly states that this is not necessary in the GPO help. I don't remember, but it's possible I too had issues ...


2

According to the Policy Definition, the maximum value for MaxShellsPerUser is 2147483647 (equivalent to [Int32]::MaxValue, indicating no practical upper limit).


2

After days of researching I haven't found the reason at the lowest meaningful level but slightly higher than tat. The script worked when the user it was logging in as was already logged in interactively on the machine. If I sign out of the machine, then the script stops working. This was a problem with WinRM and one of the workarounds was to use CredSSP ...


Only top voted, non community-wiki answers of a minimum length are eligible