Tuesday, July 31, 2012

Backing up Local Windows (Win 2003 and below) Profile Hives


A Windows User Profile is the files and directories that contain the user-specific data that define the user’s working environment. This data can include display settings, application settings, printer connections, mouse/keyboard settings and network connections. When a new user logs onto a computer, a profile is created automatically. While a user is logged on, changes made to the desktop environment are saved to their user profile. Local User Profiles are the default profile type in a Windows environment. The user profile files and folders are stored on the local machine’s hard drive.
A user profile consists of:
  • A registry hive that is essentially a database that stores the user-specific settings. This registry hive is stored in the NTUSER.DAT and USRCLASS.DAT files.
  • A set of folders that are stored in a per-user directory. Applications and other operating system components populate this user folder with subfolders and user-specific data, such as start menu items, desktop shortcuts, configuration files, startup applications.
The following script backups up a Windows 2003 (and below) local profile hive to a flat-file in the c:\ntbackups  directory which can then be sent to TSM Server using the standard dsmc command. It is a good idea to leverage the TSM Client options prenschedulecmd or preschedulecmd to run this before the start of a backup.

:: ---------------------------------------------------------------------------------------
setlocal
set ntbackup_dir=c:\asm\tivoli\tsm\baclient\ntbackups
mkdir %ntbackup_dir%
pushd %ntbackup_dir%
cmd /u /c dir c:\ntuser.dat /s /b /ah > %ntbackup_dir%\tsmback.bks
cmd /u /c dir c:\ntuser.dat /s /b >> %ntbackup_dir%\tsmback.bks
cmd /u /c dir c:\usrclass.dat /s /b >> %ntbackup_dir%\tsmback.bks
cmd /u /c dir c:\usrclass.dat /s /b /ah >> %ntbackup_dir%\tsmback.bks
%systemroot%\system32\ntbackup.exe backup "@%ntbackup_dir%\tsmback.bks" /j "TSM Export: User Profiles" /f "%ntbackup_dir%\ntbackup.bkf"
:: ---------------------------------------------------------------------------------------

Further questions comments: Call/SMS on +27 84 786 8029 or Email TSM Assist

Friday, July 27, 2012

LANFree Configuration Script for AIX

This script configures a machine's paths for the LAN-Free storage agent via the command line.
This script assumes that the DEFINE SERVER command has run and that the LAN-Free agent has been successfully defined on the TSM Server.
  
This works only on all versions of the Storage Agent and has been tested on AIX versions 5 to 6.

ASSUMPTIONS:
  • dsmadmc is located in /usr/tivoli/tsm/client/ba/bin
  • The TSM administrator account is admin and this account's password is admin12
  • The Storage Agents are define with names of the format sta_HOSTNAME


#!/bin/ksh

* -----------------------------------------------------------------------------------------------------------

DSMADMC=/usr/tivoli/tsm/client/ba/bin/dsmadmc
ID=admin
PASSW=admin12
STAGENT=sta_`hostname`

* -----------------------------------------------------------------------------------------------------------

# Delete all tape and library devices.
for i in `lsdev -Cc tape | cut -f1 -d' '`; do
        rmdev -dl $i
done

# Detect tape and library hardware - run ConfigManager
cfgmgr -v

for i in `lsdev -Cc tape | grep rmt | cut -f1 -d' '`; do
        DR_SERIAL=`lscfg -vl $i | grep Serial | tr -s '. \+' ' ' | cut -f4 -d' '`
        DRV=`$DSMADMC -id=$ID -pa=$PASSW -datao=y "select drive_name from drives where drive_serial=$DR_SERIAL"`
        $DSMADMC -id=$ID -pa=$PASSW "def path $STAGENT $DRV srct=serv destt=dr libr=lib3584 devi=/dev/$i"
done

* -----------------------------------------------------------------------------------------------------------

Thursday, July 12, 2012

Windows 2003/8 Backup Exclusion List

1. Define a client option set name.

def clo win2k3_clo descr='Client Options Set for MS-Windows 2003'

2. Add options to this clent option set:

def clientopt win2k3_clo inclexcl "exclude '?:\documents and settings\*\local settings\history\*'" f=y seq=5
def clientopt win2k3_clo inclexcl "exclude '?:\documents and settings\*\local settings\history\*.*'" f=y seq=10
def clientopt win2k3_clo inclexcl "exclude '?:\documents and settings\all users\application data\microsoft\network\downloader\qmgr*.dat'" f=y seq=15
def clientopt win2k3_clo inclexcl "exclude '?:\microsoft uam volume\...\*'" f=y seq=20
def clientopt win2k3_clo inclexcl "exclude '?:\microsoft uam volume\...\*.*'" f=y seq=25
def clientopt win2k3_clo inclexcl "exclude '?:\...\eventcache\...\*.*'" f=y seq=30
def clientopt win2k3_clo inclexcl "exclude '?:\...\system32\wins\winstmp.mdb'" f=y seq=35
def clientopt win2k3_clo inclexcl "exclude '?:\...\system32\wbem\Logs\frameWork.log'" f=y seq=40
def clientopt win2k3_clo inclexcl "exclude '?:\...\system32\perflib*.dat'" f=y seq=45
def clientopt win2k3_clo inclexcl "exclude '?:\...\system32\ntmsdata'" f=y seq=50
def clientopt win2k3_clo inclexcl "exclude '?:\...\system32\dns\...\*'" f=y seq=55
def clientopt win2k3_clo inclexcl "include '?:\...\system32\dns\backup\...\*'" f=y seq=60
def clientopt win2k3_clo inclexcl "exclude '?:\...\system32\dhcp\...\*'" f=y seq=65
def clientopt win2k3_clo inclexcl "include '?:\...\system32\dhcp\backup\...\*'" f=y seq=70
def clientopt win2k3_clo inclexcl "exclude '?:\...\system32\config\...\*'" f=y seq=75
def clientopt win2k3_clo inclexcl "exclude '?:\...\security\database\secedit.sdb'" f=y seq=80
def clientopt win2k3_clo inclexcl "exclude '?:\...\security\edb.log'" f=y seq=85
def clientopt win2k3_clo inclexcl "exclude '?:\...\security\edbtmp.log'" f=y seq=90
def clientopt win2k3_clo inclexcl "exclude '?:\...\security\tmp.edb'" f=y seq=95
def clientopt win2k3_clo inclexcl "exclude '?:\...\temp\*'" f=y seq=100
def clientopt win2k3_clo inclexcl "exclude '?:\...\tmp\*'" f=y seq=105
def clientopt win2k3_clo inclexcl "exclude '?:\...\wutemp\*'" f=y seq=110
def clientopt win2k3_clo inclexcl "exclude '?:\...\agentresponsemgr.pqf'" f=y seq=115
def clientopt win2k3_clo inclexcl "exclude '?:\...\alertsend.pqf'" f=y seq=120
def clientopt win2k3_clo inclexcl "exclude '?:\...\agentqueue.pqf'" f=y seq=125
def clientopt win2k3_clo inclexcl "exclude '?:\...\ea data. sf'" f=y seq=130
def clientopt win2k3_clo inclexcl "exclude '?:\...\edb.log'" f=y seq=135
def clientopt win2k3_clo inclexcl "exclude '?:\...\edbtmp.log'" f=y seq=140
def clientopt win2k3_clo inclexcl "exclude '?:\...\evtcons'" f=y seq=145
def clientopt win2k3_clo inclexcl "exclude '?:\...\evtsend.pqf'" f=y seq=150
def clientopt win2k3_clo inclexcl "exclude '?:\...\eventcons'" f=y seq=155
def clientopt win2k3_clo inclexcl "exclude '?:\...\extsubmit.pqf'" f=y seq=160
def clientopt win2k3_clo inclexcl "exclude '?:\...\perfsend.pqf'" f=y seq=165
def clientopt win2k3_clo inclexcl "exclude '?:\...\ntds.dit'" f=y seq=170
def clientopt win2k3_clo inclexcl "exclude '?:\...\ntfrs.jdb'" f=y seq=175
def clientopt win2k3_clo inclexcl "exclude '?:\...\tivoli\tsm\...\*.log'" f=y seq=180
def clientopt win2k3_clo inclexcl "exclude '?:\...\temp.edb'" f=y seq=185
def clientopt win2k3_clo inclexcl "exclude '?:\...\tmp.edb'" f=y seq=190
def clientopt win2k3_clo inclexcl "exclude '?:\...\usrclass.dat.log'" f=y seq=195
def clientopt win2k3_clo inclexcl "exclude '?:\...\usrclass.dat'" f=y seq=200
def clientopt win2k3_clo inclexcl "exclude '?:\...\ntuser.dat.log'" f=y seq=205
def clientopt win2k3_clo inclexcl "exclude '?:\...\ntuser.dat'" f=y seq=210
def clientopt win2k3_clo inclexcl "exclude '?:\...\*.ldf'" f=y seq=215
def clientopt win2k3_clo inclexcl "exclude '?:\...\*.mdf'" f=y seq=220
def clientopt win2k3_clo inclexcl "exclude '?:\...\*.pst'" f=y seq=225
def clientopt win2k3_clo inclexcl "exclude '?:\...\*.tmp'" f=y seq=230
def clientopt win2k3_clo inclexcl "exclude '?:\...\catalog.wci\*.000'" f=y seq=235
def clientopt win2k3_clo inclexcl "exclude '?:\pagefile.sys'" f=y seq=245
def clientopt win2k3_clo inclexcl "exclude '?:\msdos.sys'" f=y seq=250
def clientopt win2k3_clo inclexcl "exclude '?:\io.sys'" f=y seq=255
def clientopt win2k3_clo inclexcl "exclude '?:\ibmbio.com'" f=y seq=260
def clientopt win2k3_clo inclexcl "exclude '?:\ibmdos.com'" f=y seq=265
def clientopt win2k3_clo inclexcl "exclude '?:\boot.ini'" f=y seq=270
def clientopt win2k3_clo inclexcl "exclude.dir '?:\...\trend micro'" f=y seq=275
def clientopt win2k3_clo inclexcl "exclude.dir '?:\...\temporary internet files'" f=y seq=280
def clientopt win2k3_clo inclexcl "exclude.dir '?:\system volume information'" f=y seq=285
def clientopt win2k3_clo inclexcl "exclude.dir '?:\recycled'" f=y seq=290
def clientopt win2k3_clo inclexcl "exclude.dir '?:\recycler'" f=y seq=295
def clientopt win2k3_clo inclexcl "exclude.dir '?:\...\profiles\...\history'" f=y seq=300
def clientopt win2k3_clo inclexcl "exclude.dir '?:\...\Profiles\...\application data\microsoft\network\downloader'" f=y seq=305
def clientopt win2k3_clo inclexcl "exclude.dir '?:\documents and settings\...\downloader'" f=y seq=310


3. Update a client machine(s) to use this option set.

upd n NODE_NAME clo=win2k3_clo


Wednesday, July 11, 2012

How to identify/get QLogic WWN on SuSE Enterprise Linux

1.       First identify your installed or recognized

lspci | grep -i fibre



2.       On SuSE Enterprise Linux 10/11, it is on /sys/class/fc_host/hostX/port_name where X is your device.

ls /sys/class/fc_host



3.       To get the WWN, run:

more /sys/class/fc_host/host3/port_name





4.       Sample with multiple QLogic HBAs:

cat /sys/class/fc_host/host[3-4]/port_name



Steps to find the WWN Address of Fibre-Channel Adapter in AIX


To find the world-wide name (WWN) or network address of a fibre-channel (FC) card in IBM AIX:

 List all fibre-channel cards installed on the AIX Server:

# lsdev –Cc adapter | grep fcs

Then get the WWN (for fcs0 in this example):

# lscfg -vp -l fcs0 | grep "Network Address"

List Drive Letters in WINDOWS 2008

Simply run:

wmic logicaldisk get name

Display a list of Started Services from the Command Line (Windows)

To list running services, use the command:

sc query  

To create a list of all services, use:

sc query type= service state= all > allserviceslist.txt
[ take note of the space between  type= and service, and state= and all ]

To create a list of active drivers, use:

sc query type= driver
[ take note of the space between type= and driver ]

For a list of everything, use:

sc query state= all > services-all.txt
[ take note of the space between  state= and all ]

Windows provides the NET utility to interact with the services panel from the command line. From the command prompt, you can use this utility to start, stop, pause and continue services.

To display a list of services that are running on your computer, run:

net start



First of all, gain access to the Command Prompt. Click on Start, on the Search Bar type Command Prompt and hit Enter. You should now be able to see the famous black window.

Execute this command:

wmic process get description,executablepath

To create a textfile (.txt) execute this code:

wmic /output:d:\process.txt process get description,executablepath