Friday, June 29, 2012

Copy Database Wizard SQL 2008 - InnerException Login Failed for user

Have you ever tried to use the Copy Database Wizard? It is a handy tool, but troubleshooting it takes more time to do than just manually copying the database yourself. If you do try to troubleshoot, then most likely you will see this error in default setups.


StackTrace:    at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()
   at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.OpenConnection(Server& server, ServerProperty serverProp)
InnerException-->Login failed for user

On an Event ID 12550 on the source server. It is basically telling you that the account you used does not have permission to do the actions. By default the wizard will want you to use the SQL Server Agent account.  That will need permissions to create files in the log and data directories. It will also need permission to import the database files in SQL

Tuesday, June 19, 2012

Lync Reverse Proxy Certificate

Creating a certificate request with the old certreq command line is a pain. When you need to add several SAN's (subject alternative names) to the request the process gets much more convoluted. Here is the way I have done it in the past with a GUI

1.) Open up an admin mmc console
2.) add the local computer "certificates" snap in
3.) Under Personal, Right Click on certificates and click "Create Custom Request"


4.) click Next, the choose "Proceed without enrollment policy"
5.) Accept defaults and click next again
6.) Click details on the custom request and click properties. This is where you will add the certificate details.
7.) The friendly name will be what shows up for tracking.
8.) On the private key tab, make sure, under key options, to change the size to 2048, and make the private key exportable

9.) In the subject tab you will need to add the required information. As you can see the SAN's are DNS type and added under the alternative name.

10.) Once done, you can create the request and send it off to a Public Cert company.
11,) When you receive the certificate back, make sure you import it into the machine you requested it from. You then can export it with the private key so it can be imported into the ISA 2006 or TMG server. The certificate will be invalid if the private key is not kept.

Monday, June 11, 2012

Rename and Move Files with Powershell

I have a software program that will import pictures into its database. Unfortunately it cannot accept files with the same name nor can it distinguish files from each other based off on what is in the file. It does however, index these files based on the file name.

If any of you have worked with a Sharp multi-function device, you might know that when  a person scans a document to a file, it is given a random name based off criteria you select. The criteria available is limited and I needed more precise file names so that the software could index properly.

Here is what i did. I set up different "Scan to network" locations based off the file name needed. For example, Credit Card receipts would have it's own address book button, and send it to a folder called CCR inside of a network share. I would then have a script ran every so often that would move it to the right folder based off its location so the Software could import it. Here is my script:



This will take all items in e:\import\ccr and then move them to e:\import_complete along with a completely different name. The $random variable is there so files will not have the same exact name. The software can then import them with the right indexes

App-v Sequencing of Edconnect 8

The DoE released its new version of Edconnect a few months ago. With the previous version of Edconnect, Iwas able to sequence it with out any problems, but the same could not be said for its newest version. After a normal install and an edit to the OSD file to include a drive mapping, my users would open the app to find the error "system error: directory c:\iam\saig_temp\ does not exist"


Now, at that time, I was pretty busy and did not have time to properly troubleshoot why it could not see a directory which was inside the VFS. I took the easy way out and put that directory on a network share. I opened up the package in the App-v sequencer, extracted the c:\IAM folder. I then edited the package and updated the "Machine\Software\The Department of Education\Edconnect\8.x\TempDirectory" registry key to reflect the new location of the network share. I then saved the package and it started working. I was worried that multiple users using that same temp directory at the same time would cause problems, but it has been 2 months and i have heard no complaints.

Changing the primary SMTP address of Live at Edu Users

Have a name change to a student and need to change their primary email address? Unfortunately you will be unable to do that through the Web based management. You will have to use powershell to connect to your live at edu system run the following command

"set-mailbox user@campus.edu -windowsliveid newuser@campus.edu"

You can also do this to change campus.edu to a different campus. When this change is made the primary smtp address will be added as a secondary smtp address, so the recipient will still receive mail on that address. The WindowsLiveID will be changed, and they will need to log in using the new one. Need help connecting your powershell to Microsoft's? Use the following code:

Unified Messaging Extension Search

Trying to enable Unified Messaging to an Exchange recipient and it says the extension number is already assigned with another UM-enabled user? Here is a little script that will search your users for you in Exchange and let you know who has it.



The script must be run with the Microsoft.Exchange.Management.PowerShell.Admin snapin loaded in powershell. Simply run that script .\extsearch.ps1 and it will let you know which user has that extension. (it does take some time)

Scripting Live at Edu Account creation

The thing about automated account creation is that I have never thought it would save that much time. Creating a dozen or so accounts a day is not very time consuming. When i created a script that would automate it for me, I realized I would never want to go back. When my school wanted to move to Live @ Edu, I did not want to manually create them. I explored the possibility of using Identity LifeCycle Manager, but wound up just including the email account creation inside my AD account creation script.

Creating an account on Live@Edu requires three things.
1.) Password
2.) Windowsliveid (also the email)
3.) Name (also called the displayname)

So i define these variables and a few more in the main script, and call upon a second script to do the actual work. My second script:


As you can see, I define
$Display (which is lastname, firstname),
$liveid,
$password (which must be converted to securestring)
$firstname
$lastname

Connecting and disconnecting after each user will add quite a bit of time that your script needs to run, but it works great. Also keep in mind that you must put your administrative windows live id and password in plain text in the script, so it would be a good idea to keep it locked down.