Thursday, August 26, 2010

SCCM Advertised Programs Don’t Appear on Windows 2008 Server RDP Sessions

Earlier today, I came across a strange issue that arises when advertising a program to Windows Server 2008 using SCCM.  The program advertisement appeared correctly on my Windows 2003 servers remote desktop console/admin session, but the same could not said when logging on to my Windows 2008 servers.  Instead, all I saw was as a message stating “No programs are available to run from a Terminal Services session”.
image

I logged off, launched the remote desktop admin session with “mstsc.exe /admin”, but still the problem existed.  Finally, after a small amount of troubleshooting I discovered why this issue was occurring.  In Windows 2008, unlike Windows 2003, there is no longer a session id 0.  Instead, for SCCM at least, the first user that logs on will be the only user able to see what is available via Run Advertised Programs or the “Install a program from the network” section in Add/Remove programs.  On both servers that I was logging in to, there were already Remote Desktop sessions as seen below:
image[9]

In the screencap above, I’m the 2nd user with ID 3.  Notice there is no ID 0 as you would see when logging on to a Windows 2003 Server with “mstsc.exe /admin”.  As soon as I had the user with Session ID 1 log off, here’s what I saw.

image

Notice that I still have the same session ID, but now the advertised program that I expected appears.

For a better understanding of why Session 0 is no longer needed in Windows 2008 take a look at KB947723.

Thursday, August 19, 2010

Windows Live Essentials 2011 beta refresh

Read more about it here.  Here’s to hoping they fixed the account lockout issue present with Live Sync.

UPDATE:  I haven’t confirmed this myself, but comments on the Windows Team Blog indicate that the account lock-out issue still exists for Live Sync users on domain PCs.  Guess, I’ll refrain from installing Sync for now. 

Wednesday, August 18, 2010

Automating SQL 2005/2008 Express Backup in 5 Easy Steps

I was recently asked to backup all system and user databases on a SQL 2005 Express installation. Unfortunately, SQL 2005 Express native backup capabilities are not on par with SQL 2005 Standard/Enterprise. SQL Express includes functionality for backing up a single DB using SQL Server Management Studio Express, but this is only ideal for backing up a single database and it cannot be scheduled. So here are the steps for automating this process.  If you’d like more detailed information, check out this much more thorough article at http://www.sqldbatips.com/showarticle.asp?ID=27.

Step 1:

Save the lines here in a file called expressmaint.sql to C:\SQLScripts.

Step 2:

Open an administrator command prompt to “c:\SQLScripts\” and run “sqlcmd -S .\SQLExpress -i c:\sqlscripts\expressmaint.sql”.

image

Step 3:

Save the lines below in a file called sqlbackup.sql and save it in C:\SQLScripts.  Be sure to change the variable contents for @reportfldr to whatever is appropriate for your environment.

exec expressmaint
   @database      = '$(DB)',
   @optype        = 'DB',
   @backupfldr    = '$(BACKUPFOLDER)',
   @reportfldr    = 'c:\SQLScripts',
   @verify        = 1,
   @dbretainunit  = '$(DBRETAINUNIT)',
   @dbretainval   = '$(DBRETAINVAL)',
   @rptretainunit = 'copies',
   @rptretainval  = 2,
   @report        = 1

Step 4:

Save the lines below in a file called sqlbackup.cmd and save it in C:\SQLScripts.  Be sure to change “.\SQLExpress” to the name of your SQL Express server and instance” and don’t forget to change the BACKUPFOLDER location to whatever is relevant in your environment.  NOTE: Each “sqlcmd” begins a new line.

sqlcmd -S .\SQLExpress -i"c:\SQLScripts\sqlbackup.sql" -v DB="ALL_USER" -v BACKUPFOLDER="e:\SQLBackups" -v DBRETAINUNIT="days" -v DBRETAINVAL="1"

sqlcmd -S .\SQLExpress -i"c:\SQLScripts\sqlbackup.sql" -v DB="ALL_SYSTEM" -v BACKUPFOLDER="e:\SQLBackups" -v DBRETAINUNIT="days" -v DBRETAINVAL="1"

If you were to run the 2nd sqlcmd above your output would be similar to this:

image

Step 5:

Create a scheduled task to run “C:\SQLScripts\sqlbackup.cmd” at your desired backup frequency.

Friday, August 06, 2010

Windows System State Analyzer

“The basic functionality of the System State Analyzer tool is to allow you to compare two snapshots taken at different points in time. This allows you to compare the state of a machine both before and after an application install for instance.”  Read more here.

Killing a hung service

Today I came across a system that was failing to heartbeat .  Opening services.msc on the box revealed that the System Center Management service status was “Starting”.   Stopping the service from services.msc didn’t work, so I had to resort to a more forceful option.

Here’s how I did it.

  1. Open a command prompt
  2. Query for the state and PID by entering “sc queryex healthservice”
    image
  3. Now that we have the PID, we can use the Taskkill command by running “Taskkill /PID /1168 /F.  The /F switch will forcefully terminate our process.  
    image

Now you can start the HealthService.