How to remotely wipe a media card in a BlackBerry smartphone

I was very excited to see the KB17776 article released by Research In Motion today entitled How to remotely wipe an installed microSD media card in a BlackBerry smartphone.  Just yesterday we had a Storm stolen, and I was wondering how to wipe the media card.

Unfortunately, this has to be the most useless KB article ever.  I would assume any document with the words “How To” in the title would actually detail how to do something…  Here’s the remainder of the document in it’s entirety:

An installed microSD media card cannot be wiped remotely.

This is a previously reported issue that has been escalated internally to our development team. No resolution time frame is currently available.

Script to find and email files in a directory

I needed to write a batch file that would email some files, and could be run as a scheduled task.  I chose to use Blat as my email program, you can download it for free from SourceForge.

The batch file requirements were: 

1.  Had to email all the .xls files in one directory from the current date.  Luckily for me the date was in the file name, so I just had to find all files in the format *MMDDYY*.xls
 
2.  The emails had to be sent “To” some users, then “CC”d to others
 
3.  I could only use free software (no shareware) but could use our internal smtp replay server to send the mail through.
 
4. The Scheduled task that executes the script must run on a Windows 2003 server.
 
The following script is what I came up with.  I’ll go through it line by line, then post the entire thing at the end.
 
****************************************************
 
Here I’m getting the current date in the month month day day year year format, and saving it to a variable named search.  This can obviously be changed to meet your particular need
REM set search date variable in MMDDYY format for file search
REM set search to month-date-year for date formatting
for /f “Tokens=1-4 Delims=/ ” %%i in (‘date /t’) do set search=%%j%%k%%l
 
Adding a blank line to the log file ReportLog.txt since I like my logs nice and neat. Makes them easy to read.
echo. >> ReportLog.txt
 
Writing the date and time the script starts to the log file ReportLog.txt
echo %date% %time% Starting script >> ReportLog.txt
 
Using the variable search, which contains the current date, I’m getting a list of all .xls files from today and saving it in FileNames.txt
dir /b “\\server\share\%search%*.xls” > FileNames.txt
 
If there’s a problem retrieving the names of the files, write a message to the log file
IF ERRORLEVEL 1 (echo %date% %time%  problem with retrieving file names >> ReportLog.txt)
 
Using find /c to count how many files are in filenames.txt, and saving that number in the variable NUMFILES
for /f “tokens=3″ %%i in (‘find /v /c “SomeStringNotToBeFound” filenames.txt’) do set NUMFILES=%%i
 
If the variable NumFiles equals zero, there were no files found for today.  Skip to ZEROFILES to send an email alert
If %NUMFILES% EQU 0 GOTO ZEROFILES
 
If NUMFILES isn’t zero, then files exist that need to be emailed.  There may be more than one file, so we’re going to use a loop to process all the files listed in FileNames.txt
For /F “tokens=1-2* delims=” %%B IN (FileNames.txt) DO (
 
write the name of the file to the log file
echo file to email is %%B >> ReportLog.txt
 
Use blat.exe to send the email to addresses specified in tolist.txt
Use blat.exe to send emails as CC to addresses specified in cclist.txt
Attached file is listed at the end of the command
This command is all one line, it may wrap on the page
blat.exe -tf tolist.txt -cf cclist.txt -subject “Report %%B” -body “Here is the current report.” -server smtp.yourdomain.com -f sender@yourdomain.com -attach “\\server\share\%%B”
)
 
We’re done emailing the files, so skip over to WRITELOG
goto WRITELOG
 
Zero files were found, so we need to send an email alert
:ZEROFILES
 
write the name of the file to the log file, along with the date and time
echo %date% %time%  problem with retrieving number of current files >> ReportLog.txt
 
Use blat.exe to send an email alert to addresses specified in problist.txt
This command is all one line, it may wrap on the page
blat.exe -tf problist.txt -subject “Problem with Report” -body “Problem sending the current report.” -server smtp.yourdomain.com -f sender@yourdomain.com
 
Writing the date and time the script starts to the log file ReportLog.txt
:WRITELOG
echo %date% %time% Ending Script >> ReportLog.txt
 
****************************************************
 
The script in it’s entirely:
 
REM set search date variable in MMDDYY format for file search
REM set search to month-date-year for date formatting
for /f “Tokens=1-4 Delims=/ ” %%i in (‘date /t’) do set search=%%j%%k%%l
 
 
REM format ReportLog.txt
echo. >> ReportLog.txt
echo %date% %time% Starting script >> ReportLog.txt
 
 
REM Get the names of all log files for specified date, save to FileNames.txt
dir /b “\\server\share\%search%*.xls” > FileNames.txt
IF ERRORLEVEL 1 (echo %date% %time%  problem with retrieving file names >> ReportLog.txt)
 
REM Count how many files are in filenames.txt, put into %NUMFILES%
for /f “tokens=3″ %%i in (‘find /v /c “SomeStringNotToBeFound” filenames.txt’) do set NUMFILES=%%i
 
If %NUMFILES% EQU 0 GOTO ZEROFILES
 
REM loop when more than one file to be emailed
For /F “tokens=1-2* delims=” %%B IN (FileNames.txt) DO (
echo file to email is %%B >> ReportLog.txt
blat.exe -tf tolist.txt -cf cclist.txt -subject “Report %%B” -body “Here is the current report.” -server smtp.yourdomain.com -f sender@yourdomain.com -attach “\\server\share\%%B”
)
goto WRITELOG
 
:ZEROFILES
echo %date% %time%  problem with retrieving number of current files >> ReportLog.txt
blat.exe -tf problist.txt -subject “Problem with Hold Report” -body “Problem emailing the current hold report.” -server smtp.yourdomain.com -f sender@yourdomain.com
 
:WRITELOG
REM format ReportLog.txt
echo %date% %time% Ending Script >> ReportLog.txt
 
****************************************************

Howto: Disable a NIC when running Sysprep

Disabling a network card when running sysprepping a Windows machine is easy.  Two things need to happen: 

1.  Add the following command to the [GuiRunOnce] section of your sysprep.inf file
 
Command0=”C:\temp\disablenic.cmd”
 
2.  On the machine you are sysprepping, create a C:\temp\disablenic.cmd file that contains the following:
 
netsh interface set interface “Local Area Connection 2″ DISABLED
 
Change the name of the interface you want disabled as needed.  To determine the names of all network interfaces on a system, run the following command:
 
netsh interface show interface
 
Proceed with syspreping as normal. When the machine boots up, the specified network interface(s) will be disabled.

Fix: Blackberry Media Manager exits with R6025 pure virtual function call error

My Blackberry Media Manager kept exiting on me when trying to access the Media stored on my Blackberry Storm.  The specific error was:

Microsoft Visual C++ Runtime Library X Runtime Error!

Program: C:\program Files\Roxio\Media Manager 9\Mediamanager9.exe

R6025 – pure virtual function call

The problem ended up being that the RoxMediaDB9 service was disabled.

I changed the service from disabled to manual (could have been set to automatic if I wanted it to start following each reboot), started the RoxMediaDB9 service, which allowed Media Manager to start without issue.

Fix: SQL agent wont start on Windows 2003 Cluster, Event 53

The Problem

SQL Agent won’t start on a Windows cluster for a particular instance

The Symptoms

Seen in Windows Application log
 
Event: 53 Source: SQLAgent$CF3Common Category: Failover
 
[sqagtres] OnlineThread: Error 6 bringing resource online.
[sqagtres] OnlineThread: ResUtilSetResourceServiceEnvironment failed (status 6)
 
The Cause
 
In Cluster Administrator, the SQL Server Agent had lost its dependency upon the SQL server resource for the affected instance.
 
The Solution
 
Add the SQL Server dependency, bring SQL Server Agent online in Cluster Administrator

Microsoft releases load simulation tools for desktops

Microsoft has released their Remote Desktop Load Simulation Tools which have nothing to do with Remote Desktop in the RDP sense.  Instead, the tools are designed for 32-bit and 64-bit server capacity planning and performance/scalability analysis.  According to Microsoft:

In a server-based computing environment, all application execution and data processing occur on the server. Therefore it is extremely interesting to test the scalability and capacity of servers to determine how many client sessions a server can typically support under a variety of different scenarios. One of the most reliable ways to find out the number or users a server can support for a particular scenario is to log on a large number of users on the server simultaneously. The Remote Desktop Load Simulation tools provide the functionality which makes it possible to generate the required user load on the server.

Supported operating systems are:

  • Windows Server 2008
  • Windows Server 2008 Datacenter
  • Windows Server 2008 Datacenter without Hyper-V
  • Windows Server 2008 Enterprise
  • Windows Server 2008 Enterprise without Hyper-V
  • Windows Server 2008 for Itanium-based Systems
  • Windows Server 2008 R2
  • Windows Server 2008 R2 for Itanium-based Systems
  • Windows Server 2008 Service Pack 2
  • Windows Server 2008 Standard
  • Windows Server 2008 Standard without Hyper-V

(Notice the lack of Windows 2003 support?)

A minimal test environment requires:

  1. Target Remote Desktop Server
  2. Client Workstations
  3. Test Controller Host

Howto automatically change the CD-ROM drive letter after running sysprep

I’m finalizing a Windows 2003 R2 build that will become our gold image, which will be the source of all new server deployments within our organization.  One challenge I had to overcome was getting the CD-ROM/DVD drive to be set to drive Z: after the syspreped image is cloned and booted.

Many people are familiar with changing drive letters within the Device Management tool aka devmgmt.msc.  I needed to automate this task so the CD-ROM drive, which shows up as drive D on my image after running sysprep, would be automatically set to drive Z.

To accomplish this, I needed three things:

  1. An entry in the [GuiRunOnce] section of my sysprep.inf file that calls a batch file after booting up the sysprep’ed image for the first time. 
  2. The batch file mentioned in step 1, changeletter.cmd runs diskpart.exe, with the parameters supplied in drives.txt
  3. The drives.txt file, which details the diskpart.exe commands that change the CD-ROM’s drive letter from drive D to drive Z.

The applicable portion on my sysprep.inf file:

[GuiRunOnce]
Command0=”C:\changeletter.cmd”

My changeletter.cmd file:

diskpart /s c:\drives.txt

My drives.txt file:

select disk 0
select volume d
assign letter z noerr

Put all these pieces together, and your CD/DVD drive should be changed to drive letter Z after booting up the sysprep’ed image.  Note that in the [GuiRunOnce] section of the sysprep.inf file, the part to the left of the equals sign is Command0, as is Command zero.  If you wanted to run additional scripts, the next would be Command1, followed by Command2, etc.

If you’re curious about diskpart.exe, check out the details on syntax in KB300415.

Network card configuration missing after P2V using VMware Converter

Last night I converted a physical Windows 2003 R2 server to a VMware virtual machine using VMware Converter Standalone version 4.0.1.  The entire process was extremely simple, only four steps.  After the P2V conversion completed, the physical machine powered off, and the newly created VM booted up.  Everything appeared to be normal, until I realized I couldn’t RDP into the new VM.

I jumped on the server console via the Virtual Infrastructure client, and found that my VM was receiving an IP address from DHCP, rather than the static address the physical server was configured with.  I attempted to assign the static IP to the NIC, and received a message that an existing NIC already was using that IP address.   No other NICs were visible in the Network Connections applet.

I immediately thought back to my post from earlier this summer titled Fix: The IP address you have entered for this network adapter is already assigned to another adapter that is hidden from the Network Connections folder because it is not physically in the computer”  This post details how to start Device Manager in a mode that shows hidden devices.  I was able to follow the steps to remove the phantom NIC, then was able to assign the static IP address to the VM’s NIC, which allowed me to RDP into the server once again. 

The steps are:

  1. Click Start, click Run, type cmd.exe, and then press ENTER.
  2. Type set devmgr_show_nonpresent_devices=1, and then press ENTER.
  3. Type Start DEVMGMT.MSC, and then press ENTER.
  4. Click View, and then click Show Hidden Devices.
  5. Expand the Network adapters tree.
  6. Right-click the dimmed network adapter, and then click Uninstall.
Finally I configured the static IP on the NIC, and all was well.

Workaround for Dell OpenManage Server Administrator installation fails prerequisite checks

When trying to install Dell OpenManage Server Administrator (OMSA) on a PowerEdge R610 server running Windows Server 2003 R2,  I received the following error from the prerequisite checker:

 ”This is not a supported server. Server Administrator software can only be installed on supported servers.”

I recevied this error when trying to install OMSA 5.4, 5.5, and 6.0.1. To get around the error you can run the installer with the option to bypass the prerequsite checker. To do so, from command prompt, run the following:

C:\OpenManage\windows\SystemsManagement\msiexec /i SysMgmt.msi SYSTEMCHECK=NO

Dell’s official documentation says version 5.4 and 5.5 of OMSA are not supported on the R610, but it runs great on many systems in my environment.

Howto: Force ConsoleOne to connect to the master replica

When you start up ConsoleOne, the application usually selects a random read-write replica to connect to.  You cannot specify which replica to connect to, but you can tell ConsoleOne to connect to the Master replica by using the forcemaster option.

In various Novell TIDs the syntax is shown as either -forcemaster or /forcemaster or .  YMMV, and it may be dependant on your version of ConsoleOne, so try them both out.  Example syntax is:

C:\1.2\bin\ConsoleOne.exe -forcemaster

C:\1.2\bin\ConsoleOne.exe /forcemaster