Copy Files Between Untrusted Domains Programmatically

Normally on a Windows machine when you attempt to access a share in a different domain you are prompted for credentials.  However, there are no copy utilities (copy, xcopy, robocopy, etc) that pass credentials in the command line.  Also, as it is an untrusted domain, you simply can’t do a RunAs (need to manually type in a password for that anyways).

The answer was so obvious, I can’t believe it didn’t come to me right away.  However, net use, the simplest of commands, is your friend again.  Using the following command you can initiate the connection and then copy between the machines as much as you like via normal UNC path.

net use [server][path] [password] /user:[username]

copy [server][path][more path]

net use [server][path] /delete /y

By using the following syntax there is no mapped drive.  There is simply a stored connection with the associated credentials for the life of the profile or until the delete command is run. 

PSExec

On my current project they deploy PSExec to all machines.  The downside?  It is a version from 2004.  Yes, that is right from over 5 years ago.  Needless to say, there has been nothing but problems with it.  Granted, PSExec is probably one of the easiest things to upgrade as you just need to upgrade the version that you are calling PSExec from.  It then copies itself out to the machine and does it’s job.  However, if the old version was ever tried against a machine, you may be in some weird state like we were where PSExec wouldn’t start, or it would and wouldn’t close, etc.

Stumbling along the internet I found someone else who had this issue.  However, his processes doesn’t always work because there may be something hanging onto the PSExecsvc.exe file still.  Instead I recommend using the following batch file.

sc %1 stop psexesvc
sc %1 delete psexesvc
del %1admin$psexesvc.exe
del %1admin$system32psexesvc.exe

 

It just deletes the service before it tries to delete the files.  Works like a charm.

CSS Project Destination Authentication Account

Been a long time again, but I have a few updates to put up here.  They may not help a lot of people, but they are good things that I want to remember 🙂

Commerce Server uses a pretty antiquated system for doing content and code promotions.  It is called Commerce Server Staging (CSS).  We have set it up, but want to better automate the deployment of all the CSS projects (jobs).  For the life of me, I could not figure out how to add in the destination authentication account programmatically.  Thankfully it wasn’t something short sighted I was missing.  After discussing with Microsoft for awhile, there is apparently some undocumented switches on CSS.exe.  After you add the project (css.exe addproj), you then need to edit the project with the following syntax:

css.exe editproj [project] Destination=[server];[username];[password]

Yay to automation!

Update:
Turns out you can do this with the Addproj also doing the same way with the semicolon separated items for the destination.

SQL Performance Optimizations

The team that I’m currently working on is focused on performance testing. None of us on the current team are really SQL experts though and we’re running into an issue that appears to be SQL related. Well, it turns out in SQL 2005, there’s these great new things: Database Management Views. What makes them even cooler is that you can pool them all together. And the hottest thing about this whole thing, is a script we found to do most of the work on our own. This things is awesome for SQL performance testing, and will definitely get a lot of reuse, that’s for sure.

Commerce Server 2007 Performance Counters

Having issues accessing Commerce Server 2007 performance counters remotely?  We were too.  It seemed like only specific ones were able to be remotely accessed.  Well, it turns out that is “by design” (bullet point #2).  However, you can get around this by allowing the Remote Registry service run as an account that has access to the database.  Down side to that is I’m not exactly sure what permissions are actually required for the Remote Registry service (something above a normal user), and who knows what that breaks.

Published
Categorized as work

Visual Studio Test Load Agent Brain Dump

On my current project, I’m doing a lot with performance testing using Microsoft Visual Studio 2008 Test Load Agent.  Now, there’s not a whole lot of things on Microsoft’s site about it, and blog postings are fairly sparse too.  Hopefully some small nuggets listed here will be beneficial.

The first thing to note is that there is some documentation for 2005, but very little about the 2008 version.  Do not use the 2005 version if possible.  It has many blocking issues you probably will encounter.  Use 2008 as many have been fixed.  Many of the guides below are for 2005, but work just as well for 2008.

Installation:

  • Installation Guide for VS Test Load Agent
  • Firewall Visios

Configuration:

  • Misc Good Configuration”
  • In the installation documentation, it talks about if you have a domain or workgroup.  However, in many test scenarios you will have multiple domains with no trusts in place (i.e. controller sits in one domain while the machines to be tested and monitor sit in another).  Don’t panic.  Simply create the Controller service account with the same username and password in all the domains.  Make the Controller service account a member of the Performance Log Users and Performance Monitor Users groups, and it will do synchronized pass-though.

How-To’s and Walkthroughs:

FAQs and Indexes:

  • MSDN Forum FAQ
  • Ed Glas’s Content Index

Hopefully those links will help people.  This is usually the set of links I send people who are knew to the whole Visual Studio Load Test Agent stuff.

WCF Extensions and .NET 3.0 SP1

Having issues installing the WCF Extensions on Visual Studio 2005 when you have .NET 3.0 SP1 installed?  Getting an error message the looks something like the following? 

Setup has detected that a prerequisite is missing. To use Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF), November 2006 CTP you must have the .NET Framework 3.0 runtime installed. Please install the .NET Framework 3.0 runtime and restart setup.

Well, instead of just installing the application by double clicking on the MSI, run it the following way.  This ends up bypassing the prereq checks and it installs successfully.  Yay to broken installers!

msiexec /i vsextwfx.msi WRC_INSTALLED_OVERRIDE=1

Running Shoes

Holy crap.  Having the right shoes can definitely make a huge difference.  I normally just use my trail running shoes for various excercise related activities.  However, since I’m running in a relay, and by “a” relay I mean “the” relay, out in SFO (feel free to donate, it’s tax deductible!), I figured I should go a little bit more professional, especially since I normally have a hard time running long distances on pavement. 

Well, I bought the shoes on Monday, a pair of Saucony ProGrid Triumph 5’s, and this morning was the first time I was able to try them out.  Now, I’m not sure if it’s because I’ve been running a lot with hills on the treadmill and this was the first time this year outside or the new shoes, but I was able to go 2x further”>>2x further this morning than I ever had been able to outside.  Plus, I was hauling or at least it felt a whole lot faster than I normally go.  The best part was, the parts of me that normally hurt when running on the pavement for long distances, didn’t.  In fact, nothing really hurt.  I just kept crossing more and more streets since I wasn’t hurting like I normally do.

Next loop will be up to Addison to make it 7.5 miles.  Hopefully I’ll do that tomorrow or Friday now that I’ve broken in the shoes.  Plus, now that I know that 5 miles is not that big a deal, I’m going to start running to the gym and back.  What’s really wierd is that I’m actually excited about this.  I thought I wasn’t going to be in that great of shape for this relay, but now I’m not too concerned.  I just want to be able to hit 10 miles or more prior to shipping out, since I’m not doing any hilly stuff. 

SQL 2005 and Windows 2008

Having troubles running SQL Server Manager on your shiny new Windows 2008 installation?  Make sure you right click and do a “Run as administrator” on it.  Took me awhile to figure this one out.  Otherwise you’ll just get the error “Login failed for user domainuser.  (Microsoft SQL Server, Error: 18456)” even if you’re a member of the local administrators on the SQL box.

Yet another instance of where UAC sucks.

Exchange 2007 after Windows 2008 Upgrade Part 3

After having issues with a potential bug on Feb the 29th, I’ve finally gotten things straightened out. 

Today I attempted to move the mailboxes again, but received the same error message.

Summary: 1 item(s). 0 succeeded, 1 failed.
Elapsed time: 00:00:08

User’s Mailbox
Failed

Error:
The address list service on the server ‘servername.fqdn’ is not running. The Exchange server address list service failed to respond. This could be because of an address list or email address policy configuration error.

The Exchange server address list service failed to respond. This could be because of an address list or email address policy configuration error.

Exchange Management Shell command attempted:
‘fqdn/Managed Users/User’ | move-mailbox -BadItemLimit ‘10’ -TargetDatabase ‘servernameFirst Storage GroupMailbox Database’

Elapsed Time: 00:00:08

It turns out that all I needed to do was restart the System Attendant service on the machine I was trying to move the mailboxes to.  After I did that, everything moved successfully.  I then attempted to hit OWA on the new machine and it was successful!  So I finished moving all the mailboxes over, changed ISA to point to the new server name, imported the right certificate and I’m good to go.  Almost 5 days of downtime, but no email lost, yay!

Now I just need to decommission the old Exchange box and give the new one more RAM.  Not a bad few days work.