Archive for the ‘Windows Server 2003’ Category.

Script the creation of local user accounts for Commerce Server 2007

I’ll be honest … I’m lazy.  I hate doing repetitive things over, and over, and over again.  So, while I was going through and installing Commerce Server 2007 on a new virtual machine, I decided to script out the creation of the local user accounts.  Before we get to the script, a little background …

It is recommended that you create multiple accounts to handle the various roles within Commerce Server (such as the four web services, staging, etc).  In a production environment, these should be created as Domain accounts; however, in development (or the virtual world) you may not have access to, or wish to use, a domain. Consequently, you can create these users as local accounts as well.

Below is a script that will go ahead and create these local users for you (if I have time I’ll create a similar script for domain accounts).  Copy the text (or download the link) and save it to a .vbs file.  You should be able to simply double-click the file, and then open up Local Users and Groups under Computer Management to double-check.

‘ =====================================================
‘ Author:        Wade Wegner
‘ Create date:   06/13/2007
‘ Description:   Automate the creation of CS 2007 users
‘ File Name:     CreateCS2007LocalUsers.vbs

‘ =====================================================

‘ Set the local computer name
strComputer = “.”

‘ Run the Load method
Load

‘ Encapsulates the processing of this script
Sub Load()

   ’ Create the CS 2007 users
   CreateUser “CatalogWebSvc”,“Pa$$w0rd”,“Account for running the Catalog Web service”
   CreateUser “CSDMSvc”,“Pa$$w0rd”,“Account for running the Commerce Server Direct mailer service”
   CreateUser “CSHealthMonitorSvc”,“Pa$$w0rd”,“Account for running the Commerce Server health Monitoring service”
   CreateUser “CSLOB”,“Pa$$w0rd”,“Account for running the Commerce Server adapters”
   CreateUser “CSStageSvc”,“Pa$$w0rd”,“Account for running the Commerce Server Staging service”
   CreateUser “MarketingWebSvc”,“Pa$$w0rd”,“Account for running the Marketing Web service”
   CreateUser “OrdersWebSvc”,“Pa$$w0rd”,“Account for running the Orders Web service”
   CreateUser “ProfilesWebSvc”,“Pa$$w0rd”,“Account for running the Profiles Web service”
   CreateUser “RunTimeUser”,“Pa$$w0rd”,“IIS account for accessing a Commerce Server site or application”

   MsgBox “Complete!”

End Sub

‘ Create the local user
Sub CreateUser(userName, password, description)

   ’ Check to see if the user exists; if so, then skip
   If NOT CheckIfUserExists(userName) Then
      Set objComputer = GetObject(“WinNT://” & strComputer & “”)
     &
nbsp;Set
objUser = objComputer.Create(“user”, userName)

      objUser.SetPassword password
      objUser.FullName = userName
      objUser.Description = description
      objUser.Put “UserFlags”, 65600 ‘ Sets Password Never Expires to TRUE
      ’ and sets User Can’t Change Password to TRUE
      objUser.SetInfo
   Else
      MsgBox userName & ” already exists!”
   End If

End Sub

‘ Check to see if user exists
Function CheckIfUserExists(userName)

   Set objComputer = GetObject(“WinNT://” & strComputer & “”)
   objComputer.Filter = Array(“user”)
   intFound = 0

   For Each User In objComputer
      If lcase(User.Name) = lcase(userName) Then
         intFound =
      End If 
   Next

   If intFound = 1 Then
      CheckIfUserExists = True
   Else
      CheckIfUserExists = False
   End If

End Function

And there you have it!

CreateCS2007LocalUsers.vbs (2.46 KB)

I hope someone else finds this useful!

Oracle for Microsoft Developers, Part I: Installing Oracle 9.2 on Windows Server 2003

There comes a time in every Microsoft developers life that he/she will have to work with an Oracle database.  I hope that you find this to be a good experience; my experiences have thus far been a mixed bag, mostly because of my own ignorance.  Nevertheless, I’ve picked up a few things here and there, and figured that it would be worthwhile to post some of the top tips and tricks I’ve learned over the years.

In this post, I want to discuss how to setup an Oracle database server.  I am going to follow-up with a post on how to create an Oracle database.  I use those terms loosely, because the terminology within the Oracle world is different from the SQL Server world.  I promise I’ll do my best to get it right, but chances are I’ll make a mistake or two – please feel free to point out my gaffes.

So, without further ado, let’s see go through the steps needed to install Oracle 9.2 (sorry, I don’t have 10+) on Windows Server 2003 32-bit (note: there are many differences between 32-bit and 64-bit Windows, and my experience has shown that the following steps will not work in 64-bit Windows.  Perhaps I’ll follow-up in the future if I figure out how to get it to work …)

  1. Secure a copy of Oracle 9.2.  I assume that you have a copy available through work.
  2. Start the Oracle Universal Installer.  Click the Next button.

  3. Confirm the installation destination (you’ll need at least 3 GBs available for the installation) and click Next.

  4. Select “Oracle9i Database 9.2.0.1.0″, and click Next.

  5. Select “Enterprise Edition”, and click Next.  (Why?  Well, I don’t have any compelling reason here – it’s just what I’ve used to get things working …)

  6. Select “General Purpose”, and click Next.

  7. Leave the Port Number as 2030, and click Next.

  8. Define the Global Database Name.  I choose “orcl”, but feel free to choose whatever.  Make sure that the SID is unique – it’s probably easiest to make it the same value as the Global Database Name.  Click Next.

  9. Specify the Directory for Database Files.  I choose to leave the default value.  Click Next.

  10. Unless you have a reason to change it, leave the “default character set” selected, and click Next.

  11. On the Summary screen, click Install.  This installation process will take a little while.  Be patience.  Read one of my other posts, while you’re waiting.

  12. The next screen to appear is the Database Configuration Assistance.  On this screen, specify the SYS and SYSTEM passwords.  Do NOT click OK yet.

  13. Before you click OK, click the Password Management Button.  Specify passwords for SYS, SYSTEM, and DBSNMP (SCOTT too, if you’d like).

  14. Once you get to the End of Installation, click Exit.

  15. After you click Exit, the Oracle Enterprise Management Console will start.  Check and make sure you can log into your Oracle database server by expanding databases, right-click ORCL (or whatever you called it) and click Connect.  Enter the “system” Username, and change Connect as from “Normal” to “SYSDBA”.  Click OK.

  16. If you were able to successfully connect to the Oracle database server, then restart Windows.  There’s a number of reasons to do this, including updates to the PATH environment variable.

And that’s it!

Now, I realize that this installation procedure pretty much accepts the defaults, and clicks next.  However, at least you have the benefit of knowing that this procedure does work, and will prepare you for the next step: configuring Oracle databases, tablespaces, users, and user access.

Best of luck!

UNC error: XXXXXXX is not accessible. You might not have permission to use this network resource. Access is denied.

Have you ever received the following error when you tried to access a UNC path?

XXXXXXX is not accessible. You might not have permission to use this network resource. Access is denied.

I found that if I logged into some of our production servers, I was unable to connect to a UNC path on the file server (a different machine), even though I was able to access these resources locally.  The only difference I could find was that in order to access the production servers I had to use a different login than my local login (e.g. my local login had acess to the file share, but not the login I used for the production boxes).  And, as I do not have administrative rights in this domain (nor were any administrators available to assist) I couldn’t change the rights to the file server to give my production user access.

So, I needed to find a way to access the file share as my local account.  Unfortunately, I couldn’t log into the production server with my local account (a good thing, actually), and I couldn’t get Explorer.exe to runas my local account while on the server.

Then I decided to try and mount the share as a driver.  Here are the steps I took:

  1. Opened up My Computer, the click Tools –> Map Network Drive …
  2. For the folder, specify your UNC share.  Then, instead of clicking finish, click the “Connect using a different user name”.

  3. In the Connect As screen, specify your local account that has the ability to access the UNC share.

  4. Click OK, then Finish.

These steps mount the UNC share using your local account.  As a result, I was able to access the file server on the production server, which I previously hadn’t been able to do.

If you find yourself in a similar situation, these steps may provide you with a temporary work around.

I hope this helps!