Backing up DAG cluster with TSM

There is a problem with DAG cluster backup in TSM. When you create script with /PREFERDAGPASSIVE key, your script return error 464 – nothing to backup. So I’ve created script to analyze Exchange’s databases if there is healthy passive copy of database to backup, so you run backup for the only healthy copy of database and for passive healthy copies of database. If there is nothing to backup than script returns 0.

$exc_dir=”C:\Program Files\Tivoli\TSM\TDPExchange”
cd $exc_dir
Get-Date -UFormat %Y-%m-%d’ ‘%T | Out-File -Encoding utf8 -FilePath excfull.log -Append
add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
foreach ($maildatabase in Get-MailboxDatabase -Server $env:COMPUTERNAME)
foreach($dbcopy in Get-MailboxDatabaseCopyStatus $maildatabase)
if(($dbcopy.Status -eq “Mounted”) -or ($dbcopy.Status -eq “Healthy”))
if((!$dbcopy.ActiveCopy) -and ($dbcopy.MailboxServer -eq $env:COMPUTERNAME))
if($copies -lt 2)

.\tdpexcc.exe backup * full /PREFERDAGPASSIVE /tsmoptfile=dsm.opt /CONFIGfile=tdpexc.cfg /logfile=excsch.log | Out-File -Encoding utf8 -FilePath excfull.log -Append
$backupresult = $LASTEXITCODE
“Return code was $backupresult” | Out-File -Encoding utf8 -FilePath excfull.log -Append
“Nothing to backup” | Out-File -Encoding utf8 -FilePath excfull.log -Append
“Return code was $backupresult” | Out-File -Encoding utf8 -FilePath excfull.log -Append
exit $backupresult


Troubleshooting Pending schedules in TSM

Today we’ve found that one of out servers can make backups manually and works fine with polling mode, but when it is switched to prompting mode then schedule never run. After some investigation we’ve found because we thought we have a problem with port of CAD. We’ve found that TSM scheduler does not operate with data from NODES table, which contain correct names and IP addresses, but instead it uses SCHEDULE_NODE_ADDRESSES table, which only contains host names and ports. Problem server was in different AD forest and TSM sever did not have correct DNS search suffixes. After fixing DNS issues all Pending schedules disappeared.

Connecting with android Boxer mail app to hotmail account over ActiveSync

By default if you try to connect to any Hotmail e-mail with Boxer app (current version 2.0.0), which is a default in CyanogenOS 12s, it set up your account with IMAP and SMTP. Such setup prevents you from using your calendar and contacts. To fix this you should set up your connection with ActiveSync, but such option is not available by default. To set up it correctly you need to do following steps.

1. Set up your Hotmail account on your PC with Outlook. You need to do this to find server which holds your account. Correctly working e-mail agents can connect to which re-targets it to correct server, but Boxer is not such software.

2. Open Outlook with previously set up account.

3. In notification area right-click on Outlook icon holding Ctrl button and choose Connection status…

4. Write down your Server name.

5. Set up Boxer for or any other incorrect domain.

6. Choose Exchange

7. Press Cancel for auto detection

8. Correct your username and password

9. Fill in Server field with server name from step 4

10. When you press Next it will be set up.

That’s all

Cisco Any Connect with Windows 10 build 10061 Repairing vpn adapter

Today our network administrator applied latest patch to Cisco ASA. After that, any new connection with AnyConnect was starting update procedure, which failed every time even after reboot. I’ve uninstalled application and installed the newest version. After that any connection showed:

Repairing vpn adapter

Which have failed each time. To fix this I’ve changed settings for Ethernet adapter used by AnyConnect to obtain IP address automatically. After that AnyConnect reinstalled virtual adapter and connected without any issue. My colleague fixed this problem with deletion of:



TSM ANS0106E error on backup or dsmc run

Recently we’ve found that one of our TSM servers stopped to back up all virtual machines. After examination of dsmerror.log files we’ve found strange messages:

03/20/2015 09:48:42 ANS0106E Message index not found for message 2252.
03/20/2015 09:49:01 ANS0106E Message index not found for message 14320.
03/20/2015 09:49:01 ANS0106E Message index not found for message 14180.

And so on.

After quick search we’ve found official IBM article about this error.

This article suggests you to update or re-install your Backup Archive Client, installed on the TSM server. We’ve tried that with different versions of client with no result. All clients give the same error: ANS0106E.

After that we’ve started to analyze dsmc.exe process wint ProcessExplorer and found strange thing, that this process have open handles to

C:\Program Files\Tivoli\TSM\server\tsmdiag


C:\Program Files\Tivoli\TSM\baclient

where we’ve actually installed our BA Client.

So the problem was, that tsmdiag.exe utility set environment variables DSM_CONFIG and DSM_DIR, which affect Backup Archive Client behavior. So to resolve this problem you need to change mentioned environment variables or copy dscenu.txt file from your BAClient folder to tsmdiag folder.

Wmic exception occured

Some time ago we have faced problem that our script which calls wmic to get some values stopped to work. After a short research we have found that on some servers wmic utility stopped to work, showing exception every time we run any command:

wmic os get caption
Description = Exception occurred.

In the same time wbemtest and powershell worked correctly. The solution was to add “/value” switch to a command:

wmic os get caption /value
Caption=Microsoft Windows Server 2008 R2 Enterprise

For some reason wmic can’t format output as a table (the same error you can get with /format: table switch and get rid of it with /format:list), which is default, or can be done with /all switch. Hope this helps someone.

Find all VMWare VMs created in a given period

To find all virtual machines created in a given period use the following SQL script:

select ev.CREATE_TIME, EV.VM_NAME AS OldName
Where (EV.event_type = ‘vim.event.VmDeployedEvent’ OR EV.EVENT_TYPE = ‘vim.event.VmCreatedEvent’ OR EV.EVENT_TYPE = ‘vim.event.VMClonedEvent’) AND EV.CREATE_TIME >= cast(‘01.01.2013’ AS DATETIME) AND EV.CREATE_TIME <= cast(‘31.01.2014’ AS DATETIME)

Output of this script will show all created VMs including deleted ones. To show only existing virtual machines you can use following SQL script:

Where EV.VM_ID=INF.ID AND (EV.event_type = ‘vim.event.VmDeployedEvent’ OR EV.EVENT_TYPE = ‘vim.event.VmCreatedEvent’ OR EV.EVENT_TYPE = ‘vim.event.VMClonedEvent’) AND EV.CREATE_TIME >= cast(‘01.01.2013’ AS DATETIME)

As you can see it can help you to find renamed virtual machines as well. One of the biggest problem of this script is that it relies on events, which can be deleted by time when you run script. Unfortunately it is impossible to find the same data any other way. The only other solution is to use custom fields, which have to be created to the moment of need.

select ev.CREATE_TIME, EV.VM_NAME AS OldName
Where (EV.event_type = ‘vim.event.VmDeployedEvent’ OR EV.EVENT_TYPE = ‘vim.event.VmCreatedEvent’ OR EV.EVENT_TYPE = ‘vim.event.VMClonedEvent’) AND EV.CREATE_TIME >= cast(‘01.01.2013’ AS DATETIME) AND EV.CREATE_TIME <= cast(‘31.01.2014’ AS DATETIME)

Restoring MSSQL database to new location from command line with IBM TSM

Just a simple commands sequence with comments.

tdpsqlc.exe q tsm SOURCE_DB_NAME f /all

write down Database Object Name for needed full backup.

If you want to recover database backed up with options from dsm.opt file use following command:


If you want to recover database backed up with options different from dsm.opt, use following:

tdpsqlc restore SOURCE_DB_NAME full /into=DESTINATION_DB_NAME /RELocate=DATA_FILE_NAME,LOG_FILE_NAME /to=PATH_TO_DATA_FILE.mdf,PATH_TO_LOG_FILE.ldf /RECOVery=no /replace /object=DATABASEOBJECTNAME /tsmoptfile=other.opt

tdpsqlc.exe q tsm SOURCE_DB_NAME diff /all

Write down Database Object Name for needed diff backup


tdpsqlc.exe q tsm SOURCE_DB_NAME log=* /all

Write down Database Object Names for all needed log backups


…repeat for all needed logs


Do not forget to add recovery=yes to last restored log.

Listing all MSSQL performed for specific database

Yesterday I’ve stuck with restoring some MSSQL database, because of incompatibility between used differential and full backups, after I’ve found correct full backup, restore process completed without any problem. The following error identifies that:

The log or differential backup cannot be restored because no files are ready to rollforward

The following script helped me to find out correct backup chain:

TOP 100o
CASE s.type
WHEN ‘D’ THEN ‘Full’
WHEN ‘I’ THEN ‘Differential’
WHEN ‘L’ THEN ‘Transaction Log’
END AS BackupType,
CAST(DATEDIFF(second, s.backup_start_date,
s.backup_finish_date) AS VARCHAR(4)) + ‘ ‘ + ‘Seconds’ TimeTaken,
CAST(s.first_lsn AS VARCHAR(50)) AS first_lsn,
CAST(s.last_lsn AS VARCHAR(50)) AS last_lsn,
CAST(CAST(s.backup_size / 1000000 AS INT) AS VARCHAR(14)) + ‘ ‘ + ‘MB’ AS bkSize,
FROM msdb.dbo.backupset s
INNER JOIN msdb.dbo.backupmediafamily m ON s.media_set_id = m.media_set_id
WHERE s.database_name = DB_NAME() — Remove this line for all the database
ORDER BY backup_start_date DESC, backup_finish_date

You might want to replace TOP 100o with bigger value if you have a lots of backups.

Enable Text Console (SOL) on Windows Server 2012

After installing Windows 2012 on old Fujitsu Primergy RX200 we lost ability to manage it with serial console. We’ve even tried to update iRMC firmware with no luck. Problem was resolved after we enabled EMS (Emergency Management Services) with the following set of commands:

BCDedit /bootems {Boot_entry_id} ON

bcdedit /ems on

bcdedit /emssettings EMSPORT:2 EMSBAUDRATE:115200

Ensure that you’ve changed Boot_entry_id to your ID (you can get it with bcdedit /v), 2 to your COM port number (you can get it from your bios settings, or from irmc settings) and 115200 to your bauderate (you can get it from your bios settings, or from irmc settings).

Reboot and enjoy serial access to your server.