Archive for the ‘iis’ Category

using pscp.exe in a batch file and getting around the host key

March 19, 2013

I was trying to automate an scp file copy for work and having a hell of a time with the host key. Even though I was logged in as the same user that the script is running, when it’s run non interactive, for some reason it cannot find the host key in the registry, and fails. Some info.

  • putty and  pscp.exe keep their host keys in – [HKEY_CURRENT_USERSoftwareSimonTathamPuTTYSshHostKeys]
  • if you run your pscp.exe with the –batch command, you cannot input any console input
  • in order to get this to work, I had to echo a “Y” to it like thisecho y | C:_scriptspscp -sftp –v  -etc. etc

Basically, If you try to echo the Y with the –batch option, then you can’t because the –batch option makes it ignore any input. In order to make this secure, I ran it once the way I have listed above, and once the host key was stored in the right place, I removed the echo and added the batch again.


strange .net runtime error and the fix

July 20, 2011

We had done a POC for Foglight by Quest back in March and ended up not purchasing the product because we already had SCOM in place. After the uninstall and ever since, we have had some issues.

  • errors logged whenever an app pool starts/restarts containing this description
  • .NET Runtime version 2.0.50727.3603 – Failed to CoCreate profiler.
  • .net health monitoring would log an app pool start but not log an app pool stop or shutdown
  • I had the suspicion that this was related to random app pool restarts during the day on one of our webservices
  • other debuggers would not attach to an app pool and work (like avicode that comes with SCOM)
  • I looked for how to fix this since March, of course I was too stubborn to call Quest, so that’s my fault. Much googling didn’t resolve much so when I finally did figure this out, I wanted to post what I found. It turns out that debugging is set in an environment variable. Seems like it’s a session variable because it’s set in the parameters of a service, so that way it runs with the service in the user context of the service. This is something I had never run across before so it seemed kinda odd.

    In the end we had to remove the reg key “Environment” (and the contents of the key) from the two locations. This key is what sets the debugger to enabled and tells it which debugger to use.

    • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW3SVC]

    Once these have been deleted, all you have to do is IISRESET the server and the error is gone and random app pool restarts have ceased. As of this writing I have not tried to reinstall the SCOM AVIcode to the webservice, but I’m certain that it will work now.

    AV exclusions

    May 25, 2011

    This comes up often and I can never find everything in one place. This is a good post with a bunch of info and links.

    SQL query to tell if SQL logins are using Kerberos or NTLM

    March 17, 2011

    Not explanation needed here, if you know what you are looking for, this is it.

    , c.connect_time
    , s.login_time
    , s.login_name
    , c.protocol_type
    , c.auth_scheme
    , s.HOST_NAME
    , s.program_name
    FROM sys.dm_exec_sessions s
    JOIN sys.dm_exec_connections c
    ON s.session_id = c.session_id

    TFS 2008 to TFS 2010 Install notes

    March 13, 2011

    Recently (about 5 minutes ago) I did an upgrade in production of our Team Foundation 2008 server to Team Foundation 2010. I had a dry run that worked well but of course on the real thing I had a couple of issues. Here are some notes.

    • TFS requires sysadmin on the new SQL server, it wants to create/drop databases like crazy
    • TFS previous to 2010 required sharepoint to be installed, with 2010 it’s just an option, you can add it later.
    • To clean up from an earlier install (failed, test run, etc.) you can run this command (see the gotcha at the end!)

      C:Program FilesMicrosoft Team Foundation Server 2010Tools>tfsconfig setup /un

  • The steps are
    1. Install TFS 2010
    2. Configure TFS 2010 (this creates databases)
    3. Backup your old TFS databases (all of them)
    4. Restore your old TFS databases to your new sql instance
    5. Run the TFS import command from command line. It should look like this:

      C:Program FilesMicrosoft Team Foundation Server 2010Tools>Tfsconfig import /s
      qlinstance:serverinstance /collectionName:imported /confirmed

  • Once you do this, you should be good to go
  • We had an error when trying to install on production because it kept finding information from the previous one. Apparently the tsconfig /setup uninstall:all doesn’t really uninstall all! There were extended database properties left over that we had to delete manually. Until we did this, we received this error:
    • TF30046: The instance information does not match.
  • There are very useful logfiles located in:
    • C:ProgramDataMicrosoftTeam FoundationServer ConfigurationLogs
  • In order to get visual studio 2005 to connect to TFS 2010, you have to install in this order:
    1. Visual studio 2005
    2. Tfs plugin for vs 2005
    3. Vs 2005 sp1
    4. Vs 2005 vista compatibility update (run windows update)
    5. Vs 2005 TFS 2010 update
    6. Then you enter the full URL in the server name field: http://tfs2010_server:8080/tfs
    7. If it tells you that you can’t put in the “/” and such, it means you installed in the wrong order.
  • In order to get visual studio 2008 to connect to TFS 2010, you have to:
    1. Install vs 2008
    2. Install vs 2008 sp1
    3. Install vs 2008 TFS compatibility pack
    4. Enter servername as: http://tfs2010_server:8080/tfs
  • That’s all I have for now. After all the devs come in and hit this tomorrow I may have some more updates (but I hope not!).


    MSMQ MP for SCOM–has issues..

    February 21, 2011

    This is just an example of the kind of stuff I find in the MSMQ MP for scom. Is this alert about the SIZE of the messages or the NUMBER of messages?


    Dashboarding using the SCCM Dashboard solution accelerator example

    January 5, 2011

    I will turn this into a more useful blog post when I have a few minutes but for now it is just a collection of links about dashboarding using the System Center Configuration Manager Solution Accelerator. The short story is that this runs on top of Sharepoint 3.0, which is free, meaning you can run this for free. It’s not specific to SCCM so you can dashboard any sql data you want! Cool!

    urlscan issue

    November 5, 2010

    I have the following URLscan value:




    Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv: Gecko/20061204 Firefox/
    Opera/9.02 (Windows NT 5.1; U; ru)

    In the logfiles I am seeing where it is blocking non russian mozillas, like this:

    2010-11-05 21:49:23 896362 GET /programs/images/t8.jpg Rejected rule+’DenyUserAgent’+triggered User-Agent: mozilla/5.0+(windows;+u;+windows+nt+6.1;+en-us;+rv: mozilla/5.0+(windows

    (The logfile truncates after a certain length.) I do not understand why it is blocking this mozilla version with a totally different user agent. ???

    Looking for an answer on this one….

    .net apps using SQL connections that aren’t closed properly

    October 15, 2010

    I already blogged about this partially here, and of course having debug disabled comes into play as well. Anyway, we figured out a problem here at work that is well documented here. It’s a good read and was really helpful for us to figure out how to recode the app.

    scom web application monitoring part 2 – presenting the data – service levels and the dashboard

    August 30, 2010

    This is the 2nd post in a short series on monitoring web applications with SCOM. Part 1 is here.

    One of the biggest issues I have with SCOM is the sheer amount of data… it is so easy to grab a parameter here, a value here, and you throw that in with all of the stuff the management packs will give you already and suddenly you have a lot to choose from and picking and presenting that data becomes the difficult thing. Do yourself a favor and don’t show management the SCOM console, it looks more complicated than it is and I don’t think it presents that well except to technical folks.

    Creating dashboards is limited, there needs to be some more work here from Microsoft. For example, like I mentioned in my previous post, you cannot save what a performance view is supposed to look like, meaning which (or all) counters are checked. I understand why Microsoft did this for the default performance view per user, but IMO once you create a dashboard view, that becomes impractical and there should be a way to make the selections a part of the view.

    The dashboard also has the problem of not looking too great via the web console. It’s limited and looks kinda fugly. As a result we have tried using the actual SCOM client that we installed as a citrix app so that we can display it on the flat screen via the wyse terminal. This has the problem of not being able to default a view without a lot of work, and we keep running into issues where you need the detail pane here but not here, and you need to be able to select your views on the left hand side sometimes, but you don’t want the “action” pane visible, and you end up with something that looks like a hack.

    Microsoft seems to have realized this and has since created a “solution accelerator” called the service level dashboard. I’m not going to go into what it takes to install this because there are already a ton of sites out there already that have the info. It isn’t the easiest thing to get installed because it requires a sharepoint installation which it customizes and bastardizes quite a bit, and it also needs access to the operations manager database, data warehouse, pretty much everything involving SCOM. In my case it was easier to put the actual sharepoint install on my SCOM server, which I did, and ended up having to figure out why sharepoint stepped all over my SCOM website. This wasn’t rocket science but it took some effort. If I was doing it over again, I would go ahead and install sharepoint before I installed SCOM, or find a home somewhere else that isn’t on the SCOM RMS.

    Once you go through the motions of getting sharepoint and the service level dashboard installed, we can get to work.

    I ran out of time today so it looks like this will be a 3 part post.