Load "BLOG", 8, 1

This is the best I could do on short notice.
posts - 11 , comments - 3 , trackbacks - 10

Sunday, January 19, 2014

Troubleshooting "Access is denied" when trying to run Enable-PSRemoting

I recently had to trouble shoot why I was getting an "Access denied error" when trying to enable PSRemoting on hosted version of Windows 2008 R2.

The error received looked something like:

WinRM Quick Configuration Running command "Set-WSManQuickConfig" to enable
this machine
for remote management through WinRM service
This includes: 1. Starting or restarting (if already started) the WinRM service 2. Setting the WinRM service type to auto start 3. Creating a listener to accept requests on any IP address 4. Enabling firewall exception for WS-Management traffic (for http only).

Access is denied. + CategoryInfo : InvalidOperation: (:) [Set-WSManQuickConfig],
InvalidOperationException + FullyQualifiedErrorId :
WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand

I discovered that my hosting company had applied a group policy on a firewall rule,
which is modified in the 4th step when trying to enabled PSRemoting:
4. Enabling firewall exception for WS-Management traffic (for http only)


Steps to fix:
1) Click on start menu
    >> Administrative tools
    >> Windows Firewall and Advanced security

2) Click on inbound rules
    >> New rule
    >> choose the option "predefined" and select Windows Remote Management from the dropdown list
    >> Click next

3) Now, Deselect Windows Remote Management compatibility Mode(HTTP-In) and
    select Windows Remote Management Mode(HTTP-In)
    >> Click Next
    >> Allow the connection
    >> Finish

Here's a list of useful resources for debugging this, which I used before I discovered the above fix:

Trouble Shooting References:
Check that your account is in the Local Administrators group:
powershell> whoami /all

Powershell team - Enable PSRemoting (4 common trouble shooting steps)
How to run powershell commands on remote computers (Domain vs Workgroup setup)

Other Topics:
Trying to setup PSRemoting on SharePoint?
Using PowerShell remoting technologies to manage a SharePoint farm


Trying to setup PSRemoting on Windows XP?
Error enabling PSRemoting in Windows XP SP3


Are you setting up PSRemoting on a non English computer? - change it to English
Reference 1 - lanuage not specified
Reference 2 - Spanish/German


Are you using VirtualBox and trying to setup PSRemoting?
Virtualbox and needing to enable enable CredSSP
VirtualBox and setting up PSRemoting gets access denied error

Originally Answered on:

Stackoverflow
Unable to enable Powershell Remoting
Powershell enable-psremoting for remote machine

Server Fault
Enabling Powershell Remoting, Access is denied?

Enable-PSRemoting on Windows Server 2008 R2 error

Posted On Sunday, January 19, 2014 3:00 PM | Comments (0) | Filed Under [ Powershell DevOps ]

Monday, November 26, 2012

How do I programatically determine which port a SQL Server is running on?

How do I programatically determine which port a SQL Server is running on?

/*
Wrapper script for xp_readerrorlog
Author: Ralph Willgoss
Date: 2nd Oct 2012
This script cycles through all logs files, looking for the listening port.
Normally you have to specify the log file one by one, the script removes the need for that.

Param ref for: xp_readerrorlog
1. Value of error log file you want to read: 0 = current, 1 = Archive #1, 2 = Archive #2, etc...
2. Log file type: 1 or NULL = error log, 2 = SQL Agent log
3. Search string 1: String one you want to search for
4. Search string 2: String two you want to search for to further refine the results
5. Search from start time
6. Search to end time
7. Sort order for results: N'asc' = ascending, N'desc' = descending
*/

USE Master
GO
--  Get log count
DECLARE @logcount int
DROP TABLE #Result
CREATE TABLE #Result (ArchiveNo int, Date datetime, Size int)
INSERT INTO #Result
EXEC xp_enumerrorlogs
SET @logcount = (SELECT COUNT(*) FROM #Result)

-- Search the available logs
DECLARE @counter int
SET @counter = 0
WHILE @counter <= @logcount
BEGIN
   EXEC xp_readerrorlog @counter, 1, N'Server is listening on', 'any', NULL, NULL, N'asc'
   SET @counter = @counter + 1
END
GO

Posted On Monday, November 26, 2012 8:16 PM | Comments (0) |

Sunday, November 25, 2012

How do I recycle an IIS App pool with Powershell?

Reference implementation of a Powershell script to recycle app pools, in response to Rick's post:
http://www.west-wind.com/weblog/posts/2012/Oct/02/A-tiny-Utility-to-recycle-an-IIS-Application-Pool

Alternatives:

Windows 2003 & II6
C:\WINDOWS\system32>cscript.exe iisapp.vbs /a AppPoolName /r


Windows 2008 IIS7

C:\WINDOWS\system32\inetsrv\appcmd recycle apppool "MyAppPool"
Restart-WebAppPool cmdlet

#    File: RecycleAppPool.ps1
#    Author: Ralph Willgoss
#    Date: 2nd Oct 2012

#    Reference:
#    http://stackoverflow.com/questions/198623/how-do-i-recycle-an-iis-apppool-with-powershell
# =============================================================================
#    Iniatialise
=============================================================================
param ( )

=============================================================================
#   Main
=============================================================================

Write-OutPut ""
Write-OutPut "Starting Recycling App Pool"
Write-OutPut ""

$appPoolName = "AppPoolName" #$args[0]
$appPool = Get-WmiObject -namespace "root\MicrosoftIISv2" -class "IIsApplicationPool"
          | Where-Object { $_.Name -eq "W3SVC/APPPOOLS/$appPoolName" }
          
$appPool.Recycle()

Write-OutPut ""
Write-OutPut "Finished Recycling App Pool"
Write-OutPut ""

Posted On Sunday, November 25, 2012 10:36 AM | Comments (2) |

How do I programatically determine which port a SQL Server is running on?

How do I programatically determine which port a SQL Server is running on?
[The original post has been moved to here, due to issues with updating the original]

Posted On Sunday, November 25, 2012 10:20 AM | Comments (0) |

Tuesday, December 21, 2010

When debugging using Visual Studio 2010 the aspnet_wp.exe is greyed out

When debugging with Visual Studio 2010, you may find that you can't attach to the aspnet_wp.exe process as its greyed out.

One solution is to look at the Debug Diagnostic Services, it may be automatically starting and creating new instances of DbgHost.exe – leading VS to think a debugger was already attached.

Disabling this service should fix the problem of  aspnet_wp.exe being greyed out.

Posted On Tuesday, December 21, 2010 2:00 AM | Comments (0) |

Monday, June 9, 2008

Continuous Monitoring with CruiseControl.Net

I heard Owen Rogers on HanselMinutes and thought I would create a tutorial to show how easy it is to setup CruiseControl.Net as a continuous monitoring server.

My tutorial goes into how to schedule CruiseControl.Net to run at certain times and how to incorporate output from a monitoring program in the build report page for easy viewing for all.

You could find all these bits and pieces on the Internet but put together I thought might be a handy reference for people just getting started.

Continuous Monitoring using CruiseControl.Net

Comments, suggestions and feedback welcome!

Posted On Monday, June 9, 2008 6:26 PM | Comments (0) |

Sunday, August 12, 2007

Resharper 3.0.x not recognised under Visual Studio 2008 Beta 2

If you install Resharper 3.0.x and discover that Visual Studio 2008 Beta 2 hasn't recognised it, you need to run the install again with a few special command line arguments:

C:\WINDOWS\system32\msiexec.exe /i <full path to installer file>.msi VSVERSION=9.

Posted On Sunday, August 12, 2007 7:57 PM | Comments (0) |

Sunday, December 17, 2006

Error installing .Net 1.1 "Error: internal error 2709 feature GUID for use by Cartman"

I recently rebuilt a dev machine and was trying to install .Net 1.1 and got the following error:
Error: internal error 2709 feature GUID for use by Cartman

It apparently happens when something goes wrong or you have an aborted installation of .Net 1.1 framework.

The fix for this can be downloaded from this address: http://astebner.sts.winisp.net/Tools/dotnetfx_cleanup_tool.zip

Just run the tool and it cleans up everything, my install then proceded flawlessly.

I found this fix on this post originally: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=9409&SiteID=1

Posted On Sunday, December 17, 2006 1:43 PM | Comments (0) |

Thursday, October 20, 2005

Setting up an ASP.NET Website Development environment using Visual Studio .NET, Subversion and Windows XP

I've just completed a small ebook/tutorial titled Setting up an ASP.NET Website Development environment using Visual Studio .NET, Subversion and Windows XP [Link updated 23/08/2006] which you can find here [Link updated 23/08/2006].

It covers the following topics:
Setting up IIS 5.1 on Windows XP
Setting up Visual Studio .NET 2003 for debugging
Installing Apache 2.0 on Windows XP
Installing Subversion on Windows XP
Setting up Apache to recognise Subversion repositories
Setting up TortiseSVN
Creating Subversion repositories using TortiseSVN
Setting up for ASP.Net Website Development on Windows XP
Publishing a website from a Subversion Repository

The aim of this ebook is to give a developer a complete set of steps that will allow them to setup their own isolated development environment for developing websites with ASP.Net.  This environment includes the ability to debug web applications locally, source control integration and publishing to a development server.

Feedback, improvements and other suggestions are welcome.

 COMING SOON....

-> Running multiple concurrent websites on Windows XP

-> Setting up a Subversion repository viewer

-> Intergrating Subversion source control into Visual Studio.Net

 

Posted On Thursday, October 20, 2005 9:21 PM | Comments (11) |

Wednesday, August 23, 2006

Setting up an ASP.NET Website Development environment using Visual Studio .NET, Subversion and Windows XP

Hi,

I've now moved the Development environment HowTo to the Code Project. The old site will cease to exist in a few days.

You can access the new article here http://www.codeproject.com/aspnet/Subversion.asp

Unfortuneately the formatting hasn't ported over very well to the code project style, I will take some time to amend this so its easier to read and follow.

Posted On Wednesday, August 23, 2006 10:41 AM | Comments (0) |

Saturday, July 9, 2005

In the beginning....

“In the beginning was the Word, and the Word was with God, and the Word was God.”

John 1:1

Posted On Saturday, July 9, 2005 8:36 PM | Comments (0) |

Powered by: