Wednesday, October 20, 2010

Switching Service Accounts to Local Service

Changes the service account to LocalService for any services running under the hypothetical service account Netsvc.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service")
For each objService in colServices
    If objService.StartName = ".\netsvc" Then
        errServiceChange = objService.Change _
        ( , , , , , , "NT AUTHORITY\LocalService" , "") 
    End If
Next

Stopping Services Running Under a Specific Account

Stops all services running under the hypothetical service account Netsvc.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery _
    ("Select * from win32_Service")
For each objService in colServices
    If objService.StartName = ".\netsvc" Then
        errReturnCode = objService.StopService()
    End If
Next

Stopping a Service and Its Dependents

Stops the NetDDE service and all its dependent services.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Associators of " _
   & "{Win32_Service.Name='NetDDE'} Where " _
        & "AssocClass=Win32_DependentService " & "Role=Antecedent" )
For each objService in colServiceList
    objService.StopService()
Next
Wscript.Sleep 20000
Set colServiceList = objWMIService.ExecQuery _
        ("Select * from Win32_Service where Name='NetDDE'")
For each objService in colServiceList
    errReturn = objService.StopService()
Next

Starting a Service and Its Dependents

Starts the NetDDE service and all its dependent services.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service where Name='NetDDE'")
For each objService in colServiceList
    errReturn = objService.StartService()
Next
Wscript.Sleep 20000
Set colServiceList = objWMIService.ExecQuery("Associators of " _
   & "{Win32_Service.Name='NetDDE'} Where " _
        & "AssocClass=Win32_DependentService " & "Role=Dependent" )
For each objService in colServiceList
    objService.StartService()
Next

Starting AutoStart Services that have Stopped

Restarts any auto-start services that have been stopped.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
 ("Select * from Win32_Service Where State = 'Stopped' and StartMode = " _
     & "'Auto'")
For Each objService in colListOfServices
    objService.StartService()
Next

Retrieving Service Status Changes from Event Logs

Retrieves events from the System event log that have an event ID of 7036. These events are recorded any time a service changes status.

Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceEvents = objWMIService.ExecQuery _
    ("Select * from Win32_NTLogEvent Where Logfile = 'System' and " _
        & "EventCode = '7036'")
For Each strEvent in colServiceEvents
    dtmConvertedDate.Value = strEvent.TimeWritten
    Wscript.Echo dtmConvertedDate.GetVarDate   
    Wscript.Echo strEvent.Message
Next

Retrieving Service Status

Returns a list of all the services installed on a computer, and indicates their current status (typically, running or not running).

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colRunningServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service")
For Each objService in colRunningServices
    Wscript.Echo objService.DisplayName  & VbTab & objService.State
Next

Retrieving Service Properties

Retrieves a complete list of services and their associated properties. Information is saved to a text file:

C:\Scripts\Service_List.cs.
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.OpenTextFile("c:\scripts\service_list.csv", _
    ForAppending, True)
objLogFile.Write _
    ("System Name,Service Name,Service Type,Service State, Exit " _
        & "Code,Process ID,Can Be Paused,Can Be Stopped,Caption," _
        & "Description,Can Interact with Desktop,Display Name,Error " _
        & "Control, Executable Path Name,Service Started," _
        & "Start Mode,Account Name ")
objLogFile.Writeline
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
        ("Select * from Win32_Service")
For Each objService in colListOfServices
    objLogFile.Write(objService.SystemName) & ","
    objLogFile.Write(objService.Name) & ","
    objLogFile.Write(objService.ServiceType) & ","
    objLogFile.Write(objService.State) & ","
    objLogFile.Write(objService.ExitCode) & ","
    objLogFile.Write(objService.ProcessID) & ","
    objLogFile.Write(objService.AcceptPause) & ","
    objLogFile.Write(objService.AcceptStop) & ","
    objLogFile.Write(objService.Caption) & ","
    objLogFile.Write(objService.Description) & ","
    objLogFile.Write(objService.DesktopInteract) & ","
    objLogFile.Write(objService.DisplayName) & ","
    objLogFile.Write(objService.ErrorControl) & ","
    objLogFile.Write(objService.PathName) & ","
    objLogFile.Write(objService.Started) & ","
    objLogFile.Write(objService.StartMode) & ","
    objLogFile.Write(objService.StartName) & ","
    objLogFile.writeline
Next
objLogFile.Close

Resuming AutoStart Services that are Paused

Restarts any auto-start services that have been paused.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
 ("Select * from Win32_Service Where State = 'Paused' and StartMode = 'Auto'")
For Each objService in colListOfServices
    objService.ResumeService()
Next

Removing a Service

Removes a hypothetical service named DbService.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service Where Name = 'DbService'")
For Each objService in colListOfServices
    objService.StopService()
    objService.Delete()
Next

Pausing Services Running Under a Specific Account

Pauses all services running under the hypothetical service account Netsvc.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service")
For each objService in colServices
    If objService.StartName = ".\netsvc" Then
        errReturnCode = objService.PauseService()
    End If
Next

Monitoring Service Performance

Uses formatted performance counters to retrieve performance data for the DHCP Server service.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
set objRefresher = CreateObject("WbemScripting.SWbemRefresher")
Set colDHCPServer = objRefresher.AddEnum _
    (objWMIService, "win32_PerfFormattedData_DHCPServer_DHCPServer"). _
          ObjectSet
objRefresher.Refresh
For i = 1 to 60
    For Each objDHCPServer in colDHCPServer
        Wscript.Echo "Acknowledgements per second: " & _
            objDHCPServer.AcksPerSec
        Wscript.Echo "Declines per second: " & _
            objDHCPServer.DeclinesPerSec
        Wscript.Echo "Discovers per second: " & _
            objDHCPServer.DiscoversPerSec
        Wscript.Echo "Informs per second: " & objDHCPServer.InformsPerSec
        Wscript.Echo "Offers per second: " & objDHCPServer.OffersPerSec
        Wscript.Echo "Releases per second: " & _
            objDHCPServer.ReleasesPerSec
        Wscript.Echo "Requests per second: " & _
            objDHCPServer.RequestsPerSec
    Next
    Wscript.Sleep 10000
    objRefresher.Refresh
Next

Installing a Service

Installs a hypothetical service Db.exe.

Const OWN_PROCESS = 16
Const NOT_INTERACTIVE = False
Const NORMAL_ERROR_CONTROL = 2
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objService = objWMIService.Get("Win32_BaseService")
errReturn = objService.Create("DbService" ,"Personnel Database" , _
    "c:\windows\system32\db.exe", OWN_PROCESS, NORMAL_ERROR_CONTROL, "Manual", _
        NOT_INTERACTIVE, "NT AUTHORITY\LocalService", ""  )
Wscript.Echo errReturn

Enumerating Service Load Order Groups

Returns a list of all the service load order groups found on a computer, and well as their load order.

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_LoadOrderGroup")
For Each objItem in colItems
    Wscript.Echo "Driver Enabled: " & objItem.DriverEnabled
    Wscript.Echo "Group Order: " & objItem.GroupOrder
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo
Next

Enumerating Inactive Services

Returns a list of all the services installed on a computer that are currently stopped.

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & _
    "{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2")
Set colStoppedServices = objWMIService.ExecQuery _
  ("SELECT DisplayName,State FROM Win32_Service WHERE State <> 'Running'")

For Each objService in colStoppedServices
    Wscript.Echo objService.DisplayName  & " = " & objService.State
Next

Enumerating Dependent Services for a Single Service

Enumerates all the services that cannot start until the Rasman service has started.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Associators of " _
   & "{Win32_Service.Name='rasman'} Where " _
        & "AssocClass=Win32_DependentService " & "Role=Antecedent" )
For Each objService in colServiceList
    Wscript.Echo objService.DisplayName
Next

Enumerating Dependent Services for All Services

Returns a list of all the services installed on a computer that are currently stopped.

Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = _
     objFSO.OpenTextFile("c:\scripts\service_dependencies.csv", _
         ForAppending, True)
objLogFile.Write("Service Dependencies")
objLogFile.Writeline
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service")

For Each objService in colListofServices
    objServiceRegistryName = objService.Name
    objServiceDisplayName = objService.DisplayName

Set colServiceList = objWMIService.ExecQuery("Associators of " _
   & "{Win32_Service.Name='" & objServiceRegistryName & "'} Where " & _
        "AssocClass=Win32_DependentService Role=Antecedent" )


 If colServiceList.Count = 0 then
        objLogFile.Write(objServiceDisplayName) & ", None"
        objLogFile.Writeline
    Else
        For Each objDependentService in colServiceList        
            objLogFile.Write(objServiceDisplayName) & ","
            objLogFile.Write(objDependentService.DisplayName) 
        Next
        objLogFile.WriteLine
    End If
Next
objLogFile.Close

Enumerating Antecedent Services for a Single Service

Enumerates all the services that must be running before the SMTP service can be started.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery("Associators of " _
 & "{Win32_service.Name='SMTPSVC'} Where " _
    & "AssocClass=Win32_DependentService " & "Role=Dependent")       
For Each objService in colServiceList
    Wscript.Echo objService.DisplayName
Next

Determining Services that can be Stopped

Returns a list of services that can be stopped.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service Where AcceptStop = True")
For Each objService in colServices
    Wscript.Echo objService.DisplayName
Next

Determining Services Running in a Process

Returns a list of services running in the Services.exe process.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service")
For Each objService in colListOfServices
    If objService.PathName = "C:\WINDOWS\system32\services.exe" Then
        Wscript.Echo objService.DisplayName
    End If
Next

Determining Services Running in All Processes

Returns a list of processes and all the services currently running in each process.

set objIdDictionary = CreateObject("Scripting.Dictionary")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service Where State <> 'Stopped'")
For Each objService in colServices
    If objIdDictionary.Exists(objService.ProcessID) Then
    Else
        objIdDictionary.Add objService.ProcessID, objService.ProcessID
    End If
Next
colProcessIDs = objIdDictionary.Items
For i = 0 to objIdDictionary.Count - 1
    Set colServices = objWMIService.ExecQuery _
        ("Select * from Win32_Service Where ProcessID = '" & _
            colProcessIDs(i) & "'")
    Wscript.Echo "Process ID: " & colProcessIDs(i)
    For Each objService in colServices
        Wscript.Echo VbTab & objService.DisplayName
    Next
Next

Determining Services that can be Paused

Returns a list of services that can be stopped.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service Where AcceptPause = True")
For Each objService in colServices
    Wscript.Echo objService.DisplayName
Next

Configuring Service Start Options

Disables all services configured as manual start. Among other things, this prevents Power Users from being able to start these services.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service where StartMode = 'Manual'")
For Each objService in colServiceList
    errReturnCode = objService.Change( , , , , "Disabled")  
Next

Configuring Service Error Control Codes

Configures all auto-start services to issue an alert if the service fails during startup.

Const NORMAL_ERROR_CONTROL = 2
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service where ErrorControl = 'Ignore'")
For Each objService in colServiceList
    errReturn = objService.Change( , , , NORMAL_ERROR_CONTROL)  
Next

Changing a Service Account Password

Changes the service account password for any services running under the hypothetical service account Netsvc.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
    ("Select * from Win32_Service")
For Each objservice in colServiceList
    If objService.Startname = ".\netsvc" Then
        errReturn = objService.Change( , , , , , , , "password") 
    End If
Next

WSH - Stop, Start service

strState = ""
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colRunningServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service where Name='Themes' ")
For Each objService in colRunningServices
    Wscript.Echo objService.DisplayName  & VbTab & objService.State
  If objService.DisplayName = "Themes" Then
  If objService.State = " Running" Then
          errReturnCode = objService.StopService()
  Else
   errReturnCode = objService.StartService()
   End If
 End

SQL Server System Databases

An Introduction to SQL Server System Databases:

SQL Server 2008/2005) contain 5 special databases:
1. master
2. model
3. tempdb
4. msdb
5. and mssql system resource.

These databases are used by SQL Server for its own maintenance and management.


Master Database:
----------------
The master database contains all of the system level information for SQL Server – all of the logins, linked servers, endpoints, and other system-wide configuration settings. The master database is also where SQL Server stores information about the other databases on this instance and the location of their files. If the master database is not present, SQL Server cannot start.

Always take regular backups of the master database.
Since the master database hold all of the information related to logins, endpoints, linked servers, and user databases, it’s important that you take a backup of the master database after configuring any of these server level changes. Otherwise, if your SQL Server suffers a catastrophic failure, those changes will be lost to the sands of time.

 “Do not create user objects in master. Otherwise, master must be backed up more frequently.”

Model Database:
---------------
The model database is used as a template whenever a new user database is created. You can change most database properties, create users, stored procedures, tables, views, etc – whatever you do will be applied to any new databases.
The nice thing is that you can create a guaranteed set of users, stored procedures, and options (including collation options) by making changes to the model database. Once those changes are in place, they are applied to every new database.
Outside of its role as a template, model doesn’t do anything else.

MSDB Database:
-----------------
msdb is used by the SQL Server Agent, database mail, Service Broker, and other services. If you aren’t actively working with things like jobs, alerts, log shipping, etc you can pretty safely ignore msdb… sort of.
One important item is that msdb holds backup history. Using the msdb tables (you can start by taking a look at msdb.dbo.backupset), it’s possible to determine when each database and filegroup was last backed up. This is very useful, especially when you’ve just started working at a new company or taken over the maintenance of new servers.
A word of warning: you need to make sure that you are pruning old backup history from msdb. Leaving old backup data can slow down the performance of backup and restore operations, the sp_delete_backuphistory system stored procedure is mentioned. This stored procedure will delete information older than the @oldest_date parameter. It is important that you are incredibly careful when using this store procedure and don’t attempt to delete all of the backup history data in your msdb at once. Attempting to clear out a large number of database backup history records in one fell swoop can have an adverse effect on performance. I suggest removing the data one to two days at a time.

Resource database:
-------------------
The resource database is a hidden system database. This is where system objects are stored. It isn’t possible to see the resource database by normal means. However you can see the data file by navigating to C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn. The exact size and modification data of this file will be different from version to version, but the modified date should be the same date that you see when you run SELECT @@version.
It is best to think of the resource database as if it were another system DLL. The resource database is designed to make it easy for quick database upgrades. If new system objects are being put in place, it is only necessary to swap out the resource database MDF file.
Typically, the only way to view the contents of the resource database is using the OBJECT_DEFINITION system function.
SELECT OBJECT_DEFINITION(OBJECT_ID('sys.objects'))

-- on my test system this yields the following:
CREATE VIEW sys.objects AS
    SELECT name, OBJECT_ID, principal_id, schema_id, parent_object_id,
        type, type_desc, create_date, modify_date,
        is_ms_shipped, is_published, is_schema_published
    FROM sys.objects$


Tempdb Database:
----------------
We come, at last, to tempdb. Tempdb is the workhorse of the system databases. It is the workspace that SQL Server uses to store the intermediate results of query processing and sorting. You know how you see those spools in your execution plans? When you see one of those, SQL Server is probably spooling the data to a temporary table in the tempdb. Outside of storing temporary results, tempdb is also used during snapshot isolation and for user created temporary tables (this includes table variables).
One thing that is interesting to note about tempdb is that it is re-created every time the SQL Server service is started. Any objects that you have created in tempdb will be gone once the server restarts. If you want specific tables or stored procedures to always be available in tempdb, you will need to add them to the model database or else use a stored procedure to create them in tempdb when the SQL Server is started.
A properly sized and configured tempdb is vital for effective SQL Server performance. By default tempdb starts at 8MB in size and will continue to grow by ten percent until the drive is full. If the tempdb is sized too small, system resources will be used growing the tempdb file. This overhead can be avoided by increasing the default size of tempdb.

What is IPSec?

IPSEC
-----
Short for IP Security, a set of protocols developed by the IETF to support secure exchange of packets at the IP layer.
IPsec has been deployed widely to implement Virtual Private Networks (VPNs).

IPsec supports two encryption modes: Transport and Tunnel.

* Transport mode encrypts only the data portion (payload) of each packet, but leaves the header untouched.

* The more secure Tunnel mode encrypts both the header and the payload.

On the receiving side, an IPSec-compliant device decrypts each packet.
For IPsec to work, the sending and receiving devices must share a public key.
This is accomplished through a protocol known as Internet Security Association and Key Management Protocol/Oakley (ISAKMP/Oakley), which allows the receiver to obtain a public key
and authenticate the sender using digital certificates.

Additional Info refer below address:
http://www.webopedia.com/TERM/I/IPsec.html

Windows PowerShell Config

WINDOWS POWER SHELL

PS C:\scripts> cd c:\windows
PS C:\WINDOWS> 
Or, if you prefer:
PS C:\scripts> chdir c:\windows
PS C:\WINDOWS>
Set location:
PS C:\scripts> Set-Location C:\Windows
PS C:\WINDOWS>
PS C:\WINDOWS> Get-Process
//to get recursive list of all items inside the folders. (-r)
> Get-ChildItem C:\Scripts -recurse
get-alias
get-command ...
$a = Get-ChildItem C:\Scripts
$a
Save as .ps1

Note : If you had any problem while running any PowerShell script, this could be one of the problem...then type below command at command prompt, and hit enter key...
> set-executionpolicy RemoteSigned

How to install:
--------------
1. Download and install the VMware VI Toolkit for Windows.
2. Download the VMware.VIToolkit.powerpack file that is attached to this article.
3. Open the PowerGUI Admin Console.
4. In the PowerGUI Admin Console, right-click the root node and select the Import menu command.
5. Import the VMware.VIToolkit.powerpack file that you downloaded in step 2.
6. Expand the "VMware" folder.
7. Select the "Managed VMware Hosts" node and use the "Add connection..." action to start adding the VMware hosts you want to manage with the VMware PowerPack.
8. Once you have added VMware hosts that you will manage, use any of the subnodes of the Managed VMware Hosts node to manage VMware objects or the host itself.

How to upgrade:
----------------
1. Download the VMware.VIToolkit.powerpack file that is attached to this article.
2. If you added or modified items in the PowerPack since installing it, close PowerGUI and then navigate to the Quest Software\PowerGUI subfolder of your roaming profile folder. You can find this folder by executing this string in PowerShell: "$([System.Environment]::GetFolderPath('ApplicationData'))\Quest Software\PowerGUI". In this folder, make a backup copy of your Quest.PowerGUI.xml file to ensure your customizations are backed up.
3. Open the PowerGUI Admin Console.
4. In the PowerGUI Admin Console, right-click the VMware folder and select the Delete menu command.
4. Once you have deleted the old version of the VMware PowerPack, right-click the root node and select the Import menu command.
5. Import the updated VMware.VIToolkit.powerpack file that you downloaded in step 1.
6. Once you have imported the updated VMware.VIToolkit.powerpack file, your VMware PowerPack will be up to date.
How to enable vDiagram support:
1. Download the VESI_Visio.zip file that is attached to this article.
2. If you agree to abide by the enclosed Legal Agreement document, extract the VESI_Visio.vss file into your 'My Shapes' folder. This can be found by entering the following string in PowerShell: "$([System.Environment]::GetFolderPath('MyDocuments'))\My Shapes".

BackTrack Commands

Some useful commands for Back Track Operating System

>ntfsmount /dev/hda1 /mnt/hda1 //mounting your physical hard disk
>mount
>cd /mnt/hda1/WINDOWS/system32/config //accessing your windows config folder
>cp SAM SAM_old
>cp SYSTEM SYSTEM_old
>cp SECURITY SECURITY_old
>chntpw SAM SYSTEM SECURITY
when it asks for password enter "*" -- it means blank password
>Reboot

login into windows without password - yes you can enter now !

Other commands:
cd /mnt/live/dev

Friday, October 15, 2010

Importing data from Excel Sheet into Oracle Database

The SQL file (generate_load.sql) generates the LOADDATA command. Place the generated LOADDATA command and the input file in the control file with the extension .ctl. The input file should be a comma separated file. Hence change the excel file into comma separated file.  SQL*Loader (sqlldr) is the utility to use for high performance data loads.  The data can be loaded from any text file and inserted into the database.


Steps to Import data from Excel into Oracle Database :

  1. Save the xls file as a comma separated file with extension .csv

2.   Execute the generate_load.sql file which will give you the LOADDATA command.
Save it into a control file with extension .ctl like example.ctl
SQL>@generate_load.sql
It will ask for the owner name and table name give the username(which is used to connect to sqlplus) and tablename in CAPS

3.   In the example.ctl file change the .txt file to the input .csv file

4.       sqlldr userid=scott/tiger control=example.ctl log=example.log bad = example.bad
On execution of this command it will insert the rows into the table. For any error just look into the log file and the .bad file.

NOTE: Remove the headings in the Excel file, if available.

userid  - The Oracle username and password
log                   - The name of the file used by SQL*Loader to log results
control - The name of the control file.  This file specifies the format of the data to be loaded.
bad     - A file that is created when at least one record from the input file is rejected.  The rejected data records are placed in this file.  A record could be rejected for many reasons, including a non-unique key or a required column being null.



--------------------------------------------- Load.sql ----------------------------

set trimspool on 
set serverout on 
clear buffer 
undef dumpfile 
undef dumptable 
undef dumpowner 
var maxcol number 
var linelen number 
var dumpfile char(40) 
col column_id noprint 
set pages 0 feed off termout on echo off verify off 
accept dumpowner char prompt 'Owner of table to dump: ' 
accept dumptable char prompt 'Table to dump: ' 

begin 
  select max (column_id) 
  into   :maxcol 
  from   all_tab_columns 
  where table_name = rtrim (upper ('&dumptable')) and 
         owner      = rtrim (upper ('&dumpowner')); 
         
  select sum (data_length) + (:maxcol * 3)
  into   :linelen 
  from   all_tab_columns 
  where table_name = rtrim (upper ('&dumptable')) and 
         owner      = rtrim (upper ('&dumpowner')); 
end; 
-- Build a basic control file 
set line 79 
spool dtmp.sql 
select 'spool '||lower ('&dumptable')||'.par' from dual; 
spool off 


select 'userid = /'||chr (10)|| 
       'control = '||lower ('&dumptable')||'.ctl'||chr (10)|| 
       'log = '||lower ('&dumptable')||'.log'||chr (10)|| 
       'bad = '||lower ('&dumptable')||'.bad'||chr (10) 
from   dual;
spool off

spool dtmp.sql 
select 'spool '||lower ('&dumptable')||'.ctl' from dual;
spool off 

select 'load data'||chr(10)|| 
       'infile '||''''||lower ('&dumptable')||'.txt'||''''||chr (10)|| 
       'into table &&dumptable'||chr (10)|| 
       'fields terminated by '||''''||','||''''||
       ' optionally enclosed by '||''''||'"'||''''||chr (10)||'('
from   dual;
select '   '||column_name||',', column_id 
from   all_tab_columns 
where table_name = upper ('&dumptable') and 
       owner      = upper ('&dumpowner') and 
       column_id < :maxcol 
union 
select '   '||column_name, column_id 
from   all_tab_columns 
where table_name = upper ('&dumptable') and 
       owner      = upper ('&dumpowner') and 
       column_id = :maxcol 
order by 2;
select ')' from dual;
spool off

Thursday, October 14, 2010

require,call,cut,pattern

*************** library.pl ************************
our $cmd='net user anand password /add';
************* mainprogram.pl **********************
# Windows command line execution
use warnings;
use Sum; # user defined package
$\="\n";
require "library.pl"; # this statement will compile and make ready for use
#print "Test Windows Command\n";
#our $cmd = ;
#chomp($cmd);
# $cmd = "net user perluser passw0rd!";
# print "$cmd";
# ` $cmd `;
sub commandParam {
# print "command is $cmd";
$out=system($cmd);
eval{'$x=10/0'}; # exception is stored in $? by default
print "exception is : $? \n";
#print $out;
#$out=$out>>8;
if($out==0)
{
print "success";
}
else
{
print "fail";
}
return 1;
}
&commandParam;
# return 1;
# Pattern matching
# $x=172.172.172.172
# $x=~ /(\d{1,3})\.\1\.\1\.\1/;
# $x=172.22.59.10
# $x =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
# $x = 1.5.1.5
# $x =~ /(\d{1})\.(\d{1})\.\1\.\2/;
# To comment multiple lines
=cut
=cut

Win32 MsgBox

use Win32;
$\ = "\n";
MsgBox("Test", "This is a test", 48);
# display a message box with an exclamation mark and an 'Ok' button
 sub MsgBox {
    my ($caption, $message, $icon_buttons) = @_;
    my @return = qw/- Ok Cancel Abort Retry Ignore Yes No/;
    my $result = Win32::MsgBox($message, $icon_buttons, $caption);
    return $return[$result];
}
# Win32::CopyFile(FROM, TO, OVERWRITE)
print Win32::CopyFile("C:\\test.txt", "C:\\test1.txt", true);
print Win32::DomainName();
print Win32::FsType();
#print Win32::GetFullPathName();
print Win32::GetNextAvailDrive();

Telnet

use Net::Telnet;
our $TelnetLoginPrompt ='/C:\\\\Documents and Settings\\\\Administrator>$/i';      #'/C:\\\\Users\\\\Administrator>$/i';     # '/C:\\\\Documents and Settings\\\\Administrator>$/i';
print $TelnetLoginPrompt;
$AttackSourceIP = "127.0.0.1";
$telnet = Net::Telnet->new(timeout=>10, errmode=>'die', prompt => $TelnetLoginPrompt); # '/C:\\\\Documents and Settings\\\\Administrator>$/i'
$telnet->open($AttackSourceIP);   # $AttackSourceIP is global variable
$telnet->login('administrator','qa08@');

Writing to Log File

#!/usr/bin/perl
#   $Id: example-01.pl,v 1.1 2007-08-19 11:19:47 adam Exp $
#   Standard module loading
use strict;
use warnings;
use Log::Trivial;
#   Create a logging object
my $logger = Log::Trivial->new(
    log_file  => 'C:/example.log',
    log_tag   => $$,
    set_level => 3,
);
#   Do stuff #  Log it
$logger->write( 'Stuff worked' );
#   Do more stuff
#   Log that too
$logger->write( 'Did more stuff' );

=cut
# Creates Log file
use Log::Trivial;
$logfile = "C:\\IBM\\Perl Automation_1\\LogFiles\\fimlog\\SetUpStatus.xls";
print $logfile;
# $logger = Log::Trivial->new(log_file => "$logfile", log_level => 3, log_tag => q{});
$logger = Log::Trivial->new(log_file => $logfile, log_level => 1, log_tag => {});
$logger->write("PSW Setup Log\n");
$logger->write("PSW Automation Smoke Test Results Log");
$logger->write(" ");
$logger->write(" ");
=cut

File Handle

# Program to read directory
use warnings;
# file contains first line as 'helo' and second line as 'world'
$\ = "\n"; # newline character added after each print statement
# $* = 1;    # for multi line reading
open(LOG, '<C:/test.txt') || die "can't open";
print "opened";
while(<LOG>)
{
  #chop($_);  # removes last character in the line or word
  print $_;
  if ($_ =~ "helo")
  {
    print "Yes its helo";
  }
  else
  {
    print "else part - world";
  }
}
# working with directories
opendir(DIR, "C:/parent") || die "can't open directory";
@arr = readdir(DIR);
print join("::",@arr);
$len = @arr;
print $len;
rewinddir(DIR); # rewind is used to move to first position
while($file=readdir(DIR))
{
$pos = telldir(DIR);  # to get the position
print $file;
print $pos;
  if ($pos==30)
  {
    #  if you uncomment this line, it will run as infinite loop
    #  Seekdir is used to goto specified position
    # seekdir(DIR,5);
    print "go back to pos 30";
  }
}
mkdir("C:/parent/child4",0777);
rmdir("C:/parent/child4");
print "error ::".$!;    # . is used to concatenate two text messages.
# creates file if its not created, using > or >>(append), < readonly won't create file.
open(FHDLE, '>>C:/parent/abc.txt') || die "can't open";
# below print statement will write welcome in the file.
print FHDLE "welcome";
print FHDLE "Ananya";
# if we delete text in abc1, abc text also will get delete
# In Unix we can create file like below:
# system(touch "../abc.txt");
link("C:/parent/abc.txt","C:/parent/link.txt");
unlink("C:/parent/link.txt");
#print unlink("C:/parent/abc1.txt");

do, require, subroutine calls, pointers, references, dereferences

****************** docalled.pl *********************
use warnings;
$\ = "\n";
print "welcome : we are in doCalled.pl script";
$a = 10;
$b = 20;
$c = defined;
# $d = undef;

sub calc($a, $b)
{
$c = $a + $b;
print "C ::".$c;
}
&calc;

sub egsub
{
local($x, $y) = @_;
$result = $x+$y;
print "Result ::".$result;
# return($x++ * $y++);
}
&egsub(12,12);

# using arrays passed by reference (typeglobbing)
@a = ("1","2","3");
@b = ("4","5","6");
&egval(@a, @b);
sub egval
{
local(*a, *b) = @_;
# print @a; # prints 123
@a = ("a","b","c");
@b = ("d","e","f");
}
# print @a; print @b;
&egval; # array values will now change to a,b,c and d,e,f instead of 1,2,3 and 4,5,6
#print @a; print @b;

# array passed by reference
@a1 = ("apple","dog","cat");
@a2 = ("one","two","three");
&egsub7(\@a1, \@a2);
sub egsub7
{
local($a1ref, $a2ref) = @_;
#print $a1ref; # prints ARRAY(0x277c344)
#print $a2ref; # prints ARRAY(0x277c3a4)
#print @$a1ref; # prints appledogcat
#print @$a2ref; # prints onetwothree
@arr1 = @$a1ref;
print $arr1[0]; # prints apple
print "testing ".$$a1ref[1];
#foreach $e(@$a2ref)
$count = @$a2ref; # count stores length of the array
print $count;
for( $i=0; $i<=$count; $i++ ) { print $i; print $$a2ref[$i]; } @$a1ref = ("new","values","dude"); print @$a1ref; # prints newvaluesdude } # array of references @fruits = ("apple", "orange", "grape"); @vegies = ("onion", "carrot"); @collection = (\@fruits, \@vegies); $arry = $collection[0]; print "::".@$arry; # below - for loop statement prints both fruits and vegies items $len1 = @collection; #print $len1; # prints 2 for($i=0; $i<$len1; $i++) { $len1 = @{$collection[$i]}; # important step - to read array references # print $len1; # prints values as 3 and 2 as array size for($j=0; $j<$len1; $j++) { #print $collection[$i][$j]; or below statement , both same print $collection[$i]->[$j];
}
}

return 1;


*********************** docalling.pl **********************

# doCalling - call doCall script
# do - will load into memory, even if its already loaded, compile and executes.
# require - will not load if its already loaded, it take parameter as file path or filename.
# if both statements were used as below, its executing only once.
use warnings;
$\ = "\n";
do "E:\\practice perl programs\\doCalled.pl"; # do "doCalled.pl";
# require "E:\\practice perl programs\\doCalled.pl"; # require "doCalled.pl";
print "Yes doCalled.pl has executed !!!";
print "We are in doCalling.pl";
&calc;
&egsub(13,13);

Win32 package

use Win32;
$\ = "\n";
$OSVersion = Win32::GetOSVersion();
$NextAvailDrive = Win32::GetNextAvailDrive();
print "OS version shows in numeric :: ". "$OSVersion";
print "Next available drive is :: $NextAvailDrive";
print Win32::LoginName();
#print Win32::MsgBox("Hello",3);
print Win32::GetFullPathName("noname.pl");

shift, unshift, pop, push, splice

# shift, unshift, pop, push, splice
#use strict;
use warnings;
$\ = "\n";
print "Shift Operator - removes first element from the list/array";
my @testarray = ("alpha", "beta", "gamma");
# print $testarray[0];
# print @testarray;
my $val = shift(@testarray);
print $val;
print @testarray; # returns beta and gamma only
print "\n Unshift Operator - returns total elements.";
my @a = (a,b,c);
my $ret = unshift(@a,1,2,3);
print $ret; # returns numreic value 6.
print "\n POP Operator - removes top most element in the list ie., last element";
my @b = (11,12,13,14);
print pop(@b); # returns item which it is going to remove
print @b;
print "\n Push Operator - appends new element and returns new count NUMERIC.";
my @c = (1);
my $num = push(@c,2,4,6,8);
print $num;
print @c;
print "\n Splice Operator - returns list";
my @list = ("a","b","c","d","e");
my @result = splice(@list,0,3,"+","*","-");
print @result;
print @list;
return 1;

require, subroutine call, cut, pattern matching

*************** library.pl ************************
our $cmd='net user anand password /add';

************* mainprogram.pl **********************
# Windows command line execution
use warnings;
use Sum; # user defined package

$\="\n";
require "library.pl"; # this statement will compile and make ready for use
#print "Test Windows Command\n";
#our $cmd = ;
#chomp($cmd);
# $cmd = "net user perluser passw0rd!";
# print "$cmd";
# ` $cmd `;
sub commandParam {
# print "command is $cmd";

$out=system($cmd);
eval{'$x=10/0'}; # exception is stored in $? by default
print "exception is : $? \n";
#print $out;
#$out=$out>>8;
if($out==0)
{
print "success";
}
else
{
print "fail";
}
return 1;
}

&commandParam;
# return 1;

# Pattern matching
# $x=172.172.172.172

# $x=~ /(\d{1,3})\.\1\.\1\.\1/;

# $x=172.22.59.10

# $x =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;

# $x = 1.5.1.5
# $x =~ /(\d{1})\.(\d{1})\.\1\.\2/;

# To comment multiple lines
=cut
=cut

keys, values, delete, each, exists

#Keys, Values, delete, each, exists
use warnings;
$\="\n";
print "Keys & Values example";
my %kvpair = ("a",1,"b",2,"c",3);
print keys(%kvpair);
print values(%kvpair);
print "\n DELETE example returns value";
%Hash = (1,one,2,two,3,three);
print delete($Hash{1});
print %Hash;
print "\n EACH returns key and value";
%NumberWord = (1,one,2,two,3,three);
print("each()");
while (($number,$wordform)=each(%NumberWord))
{
print("$number:$wordform");
}
print "\n EXISTS returns true or false";
%test = (one,1,two, 2);
if (exists $test{one})
{
print "success";
}
else
{
print "failed";
}

shift, unshift, pop, push, splice

# shift, unshift, pop, push, splice
#use strict;
use warnings;
$\ = "\n";
print "Shift Operator - removes first element from the list/array";
my @testarray = ("alpha", "beta", "gamma");
# print $testarray[0];
# print @testarray;
my $val = shift(@testarray);
print $val;
print @testarray; # returns beta and gamma only
print "\n Unshift Operator - returns total elements.";
my @a = (a,b,c);
my $ret = unshift(@a,1,2,3);
print $ret; # returns numreic value 6.
print "\n POP Operator - removes top most element in the list ie., last element";
my @b = (11,12,13,14);
print pop(@b); # returns item which it has removed
print @b;
print "\n Push Operator - appends new element and returns new count NUMERIC.";
my @c = (1);
my $num = push(@c,2,4,6,8);
print $num;
print @c;
print "\n Splice Operator - returns list";
my @list = ("a","b","c","d","e");
my @result = splice(@list,0,3,"+","*","-");
print @result;
print @list;
return 1;

Wednesday, October 13, 2010

Types Of Testing

There are 18 types of testing.
1. Build Verification Testing.
2. Regression Testing.
3. Re – Testing.
4. α - Testing.
5. β - Testing.
6. Static Testing.
7. Dynamic Testing.
8. Installation Testing.
9. Compatibility Testing.
10. Monkey Testing
11. Exploratory Testing.
12. Usability Testing.
13. End – To – End Testing.
14. Port – Testing.
15. Reliability Testing
16. Mutation Testing.
17. Security Testing.
18. Adhoc Testing.


1) Sanitary Testing / Build Verification Testing / Build Accepting Testing.
It is a type of testing in which one will conduct overall testing on the released build in order to check weather it is proper for further details testing or not.

Some companies even call it as Sanitary Testing and also Smoke Testing. But some company’s will say that just before the release of the built the developer’s will conduct the overall testing in order to check weather the build is proper for detailed testing or not that is known as Smoke Testing and once the build is released once again the testers will conduct the over all testing in order to check weather the build is proper for further detailed testing or not. That is known as Sanitary Testing.

2) Regression Testing
It is a type of testing in which one will perform testing on the already tested functionality again and again this is usually done in scenarios (Situations).

Scenario 1:
When ever the defects are raised by the Test Engineer rectified by the developer and the next build is released to the testing department then the Test Engineer will test the defect functionality and it’s related functionalities once again.

Scenario 2:
When ever some new changes are requested by the customer, those new features are incorporated by the developers, next built is released to the testing department then the test engineers will test the related functionalities of the new features once again which are already tested. That is also known as regression testing.
Note:
Testing the new features for the first time is new testing but not the regression testing.

3) Re – Testing:
It is a type of testing in which one will perform testing on the same function again and again with multiple sets of data in order to come to a conclusion whether the functionality is working fine or not.

4) α - Testing:
It is a type of testing in which one (I.e., out Test Engineer) will perform user acceptance testing in our company in the presents of the customer.
Advantages:
If at all any defects are found there is a chance of rectifying them immediately.

5) β - Testing:
It is a type of testing in which either third party testers or end users will perform user acceptance testing in the client place before actual implementation.

6) Static Testing:
It is a type of testing in which one will perform testing on an application or it’s related factors with out performing any actions.
Ex: GUI Testing, Document Testing, Code reviewing and etc…

7) Dynamic Testing:
It is a type of testing in which one will perform testing on the application by performing same action.
Ex: Functional Testing.

8) Installation Testing:
It is a type of testing in which one will install the application in to the environment by following the guidelines given in the deployment document and if the installation is successful the one will come to a conclusion that the guidelines are correct otherwise the guidelines are not correct.

9) Compatibility Testing:
It is a type of testing in which one may have to install the application into multiple number of environments prepared with different combinations of environmental components in order to check whether the application is suitable with these environments or not. This is use usually done to the products.

10) Monkey Testing:
It is a type of testing in which one will perform some abnormal actions intentionally (wanted) on the application in order to check its stability.

11) Exploratory Testing:
It is a type of testing in which usually the domain expert will perform testing on the application parallel by exploring the functionality with out having the knowledge of requirements.

12) Usability Testing:
It is a type of testing in which one will concentrate on the user friendliness of the application.

13) End – To – End Testing:
It is a type of testing in which one will perform testing on a complete transaction from one end to another end.

14) Port Testing:
It is a type of testing in which one will check weather the application is comfortable or not after deploying it into the original clients environment.

15) Reliability Testing (or) Soak Testing:
It is a type of testing in which one will perform testing on the application continuously for long period of time in order to check its stability.

16) Mutation Testing:
It is a type of testing in which one will perform testing by doing some changes

For example usually the developers will be doing any many changes to the program and check it’s performance it is known as mutation testing.

17) Security Testing:
It is a type of testing in which one will usually concentrate on the following areas.
i) Authentication.
ii) Direct URL Testing.
iii) Firewall Leakage Testing.


i) Authentication Testing:
It is a type of testing in which a Test Engineer will enter different combinations of user names and passwords in order to check whether only the authorized persons are accessing the application or not.

ii) Direct URL Testing:
It is a type of testing in which a test engineer will specified the direct URL’s of secured pages and check whether they are been accessing or not.

iii) Firewall leakage Testing:
It is a type of testing in which one will enter as one level of user and try to access the other level unauthorized pages in order to check whether the firewall is working properly or not.

18) Adhoc Testing:
It is a type of testing in which one will perform testing on the application in his own style after understanding the requirements clearly.

Levels Of Testing

There are 5 levels of testing.
1) Unite level testing
2) Module level testing
3) Integration level testing
4) System level testing
5) User acceptance level testing


1) Unit level testing
If one performs testing on a unit then that level of testing is known as unit level testing. It is white box testing usually developers perform it.
Unit: - It is defined as a smallest part of an application.
2) Module level testing
If one perform testing on a module that is known as module level testing. It is black box testing usually test engineers perform it.

3) Integration level testing
Once the modules are developing the developers will develop some interfaces and integrate the module with the help of those interfaces while integration they will check whether the interfaces are working fine or not. It is a white box testing and usually developers or white box testers perform it.

The developers will be integrating the modules in any one of the following approaches.
i) Top Down Approach (TDA)
In this approach the parent modules are developed first and then integrated with child modules.
ii) Bottom Up Approach (BUA)
In this approach the child modules are developed first and the integrated that to the corresponding parent modules.
iii) Hybrid Approach
This approach is a mixed approach of both Top down and Bottom up approaches.
iv) Big Bang Approach
Once all the modules are ready at a time integrating them finally is known as big bang approach.

STUB :
While integrating the modules in top down approach if at all any mandatory module is missing then that module is replaced with a temporary program known as STUB.

DRIVER :
While integrating the modules in bottom up approach if at all any mandatory module is missing then that module is replaced with a temporary program known as DRIVER.

4) System level testing
Once the application is deployed into the environment then if one performs testing on the system it is known as system level testing it is a black box testing and usually done by the test engineers.

At this level of testing so many types of testing are done.

Some of those are :
1. System Integration Testing
2. Load Testing
3. Performance Testing
4. Stress Testing etc….
5) User acceptance testing.
The same system testing done in the presents of the user is known as user acceptance testing. It s a black box testing usually done by the Test engineers.

Testing Methodology

TESTING METHODOLOGY (OR) TESTING TECHNIQUES

There are 3 methods are there
1. Black Box Testing.
2. White Box Testing.
3. Gray Box Testing

1 Black Box Testing
It is a method of testing in which one will perform testing only on the functional part of an application with out having any structural knowledge. Usually test engineers perform it.

2 White box Testing (Or) Glass box Testing (Or) Clear box Testing
It is a method of testing in which one will perform testing on the structural part of an application. Usually developers are white box testers perform it.

3 Gray box Testing
It is a method of testing in which one will perform testing on both the functional part as well as the structural part of an application.

Note:
The Test engineer with structural Knowledge will perform gray box testing.

Tuesday, October 12, 2010

SDLC Concepts

SDLC (Software Development Life Cycle) :

It contains 6 phases.
* INITIAL PHASE / REQUIREMENT PHASE.
* ANALYSIS PHASE.
* DESIGN PHASE.
* CODING PHASE.
* TESTING PHASE.
* DELIVERY AND MAINTENANCE PHASE.

Initial Phase :
Task:
Interacting with the customer and gathering the requirements.
Roles:
BA (Business Annalist)
EM (Engagement Manager)
Process:
First of all the business analyst will take an appointment from the customer, collects the templates from the company meets the customer on the appointed date gathers the requirements with the support of the templates and comeback to the company with a requirements documents. Then the engagement manager will check for the extra requirements if at all he fined any extra requirements he is responsible for the excess cast of the project. The engagement manager is also responsible for prototype demonstration in case of confused requirements.

Template:
It is defined as a pre-defined format with pre-defined fields used for preparing a document perfectly.

Prototype:
It is a rough and rapidly developed model used for demonstrating to the client in order to gather clear requirements and to win the confidence of a customer.

Proof:
The proof of this phase is requirements document which is also called with the following name
FRS - (Functional Requirement Specification)
BRS - (Business Requirement Specification)
CRS - (Client/Customer Requirement Specification)
URS - (User Requirement Specification)
BDD - (Business Design Document)
BD - (Business Document)

Note: Some company’s may the over all information in one document called as ‘BRS’ and the detailed information in other document called ‘FRS’. But most of the company’s will maintain both of information in a single document.

Analysis Phase :
Task:
Feasibility study.
Tentative planning.
Technology selection.
Requirement Analysis.

Roles:
System Analyst (SA)
Project Manager (PM)
Team Manager (TM)
Process:
(I) Feasibility study It is detailed study of the requirements in order to check whether all the requirements are possible are not.
(II) Tentative planning the resource planning and time planning is temporary done in this section.
(III) Technology selection the lists of all the technologies that are to be used to accomplish the project successfully will be analyzed listed out hear in this section.
(IV) Requirement analysis
The list of all the requirements like human resources, hardware, software required to accomplish this project successfully will be clearly analyzed and listed out hear in this section.

Proof:
The proof of this phase is SRC (Software Requirement Specification).

Design phase :
Tasks:
HLD (High Level Designing)
LLD (Low Level Designing)

Roles:
HLD is done by the CA (Chief Architect).
LLD is done by the TL (Technical Lead).

Process :
The chief architect will divided the whole project into modules by drawing some diagrams and technical lead will divided each module into sub modules by drawing some diagrams using UML (Unified Modeling Language).
The technical lead will also prepare the PSEUDO Code.

Proof:
The proof of this phase is technical design document (TDD).

Pseudo Code:
It is a set of English instructions used for guiding the developer to develop the actual code easily.

Module:
Module is defined as a group of related functionalities to perform a major task.

Coding Phase :
Task:
Programming / Coding.
Roles:
Developers / Programmers.
Process:
Developers will develop the actual source code by using the PSUEDO Code and following the coding standards like proper indentation, color-coding, proper commenting and etc.

Proof :
The proof of this phase is SCD (Source Code Document).

Testing Phase :
Task:
Testing.
Roles:
Test Engineer.
Process:
1. First of all the Test Engineer will receive the requirement documents and review it for under studying the requirements.

2. If at all they get any doubts while understanding the requirements they will prepare the Review Report (RR) with all the list of doubts.

3. Once the clarifications are given and after understanding the requirements clearly they will take the test case template and write the test cases.

4. Once the build is released they will execute the test cases.

5. After executions if at all find any defects then they will list out them in a defect profile document.

6. Then they will send defect profile to the developers and wait for the next build.

7. Once the next build is released they will once again execute the test cases

8. If they find any defects they will follow the above procedure again and again till the product is defect free.

9. Once they feel product is defect free they will stop the process.

Proof:
The proof of this phase is Quality Product.
Test case:
Test case is an idea of a Test Engineer based on the requirement to test a particular feature.

Delivery and Maintenance phase :
Delivery:
Task:
Installing application in the client environment.
Roles:
Senior Test Engineers / Deployment Engineer.
Process:
The senior test engineers are deployment engineer will go to the client place and install the application into the client environment with the help of guidelines provided in the deployment document.

Maintenance:
After the delivery if at all any problem occur then that will become a task based on the problem the corresponding roll will be appointed. Based on the problem role will define the process and solve the problem.


Additional Info:
Where exactly testing comes in to picture?
Which many sort of testing are there?

There are two sorts of testing.
1. Unconventional testing
2. Conventional testing

Unconventional Testing:
It is a sort of testing in which quality assurance people will check each and every out come document right from the initial phase of the SDLC.

Conventional Testing:
It is a sort of testing in which the test engineer will test the application in the testing phase of SDLC.

How Licensing Server works?

When customer sends a request to any Licensing Server, actually request will be validated/authenticated by considering two things
1. Token ID (40 characters) / UserID & Password
2. Entitlements (This will have information of customer purchased products, License validity period and each product 'in use' count information)

Suppose customer purchased “XYZ Product” license for 10 desktops, and if customer has installed on 15 machines, in your License Summary tab you can observe that specific agent entry shows in red color (you can observe "IN USE" column in license summary).
If "in use" is more than what you really have then you cannot download updates for your product. This is how we can prevent users from downloaded updates for unauthorized licensing.

How Licensing Server can help issuer?:
1. Track customer usage easily
2. Monitor compliance
3. Reduce security risks
4. Minimize risk of a security audit
5. Reduce costs by paying for only what customer use


Each time you purchase a product, Company will update Customer Company’s record with that purchase allowing your organization to minimize the number of keys.

To Generate a XYZ product Token?
First, customer should see license issuer company, Customer Welcome Kit for information on creating a Customer Support Portal Login, and that it is associated with your company

If already have an Token number? :
If the end-user for the new product is the same, the organization record will have been updated with the new purchase information. The License issuer company back-end will automatically update the customer system or the Local Management Interface with new purchases the next time it contacts Licensing Server.

Hope this info would definitely help everybody who reads this article to some extent, in analyzing your requirement and to move forward.

Attacks, Threats

Command Execution :
The Command Execution section covers attacks designed to execute remote commands on the web site. All web sites utilize user-supplied input to fulfill requests. Often these user-supplied data are used to create construct commands resulting in dynamic web page content. If this process is done insecurely, an attacker could alter command execution.

Buffer Overflow :
Buffer Overflow exploits are attacks that alter the flow of an application by overwriting parts of memory.

Format String Attack :
Format String Attacks alter the flow of an application by using string formatting library features to access other memory space.

LDAP Injection :
LDAP Injection is an attack technique used to exploit web sites that construct LDAP statements from user-supplied input.

OS Commanding :
OS Commanding is an attack technique used to exploit web sites by executing Operating System commands through manipulation of application input.

SQL Injection :
SQL Injection is an attack technique used to exploit web sites that construct SQL statements from user-supplied input.

SSI Injection :
SSI Injection (Server-side Include) is a server-side exploit technique that allows an attacker to send code into a web application, which will later be executed locally by the web server.

XPath Injection :
XPath Injection is an attack technique used to exploit web sites that construct XPath queries from user-supplied input.

Client-side Attacks :
The Client-side Attacks section focuses on the abuse or exploitation of a web site's users. When a user visits a web site, trust is established between the two parties both technologically and psychologically. A user expects web sites they visit to deliver valid content. A user also expects the web site not to attack them during their stay. By leveraging these trust relationship expectations, an attacker may employ several techniques to exploit the user.

Content Spoofing :
Content Spoofing is an attack technique used to trick a user into believing that certain content appearing on a web site is legitimate and not from an external source.

Cross-site Scripting :
Cross-site Scripting (XSS) is an attack technique that forces a web site to echo attacker-supplied executable code, which loads in a user's browser.

LDAP Injection :
LDAP is an acronym for Lightweight Directory Access Protocol. LDAP is a protocol to store information about users, hosts, and many other objects. LDAP injection is a server side attack, which could allow sensitive information about users and hosts represented in an LDAP structure to be disclosed, modified, or inserted.
This is done by manipulating input parameters afterwards passed to internal search, add, and modify functions.

Let's suppose we have a web application using a search filter like the following one:
usersearchfilter="(usr="+username+")"
which is instantiated by an HTTP request like this:
http://www.example.com/ldapsearch?username=satish
If the value 'satish' is replaced with a '*', by sending the request:
http://www.example.com/ldapsearch?user=*
the filter will look like:
usersearchfilter="(usr=*)"
which matches every object with a 'usr' attribute equals to anything.
If the application is vulnerable to LDAP injection, it will display some or all of the users' attributes, depending on the application's execution flow and the permissions of the LDAP connected user.
A tester could use a trial-and-error approach, by inserting in the parameter '(', '|', '&', '*' and the other characters, in order to check the application for errors.

QTP File System Object

FileSystemObject
================

Accessing Existing Drives, Files, and Folders
---------------------------------------------
To gain access to an existing drive, file, or folder, use the appropriate "get" method of the FileSystemObject object:

GetDrive
GetFolder
GetFile

Creating a NewFolder
--------------------
Dim fso, f, fc, nf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(path)
Set fc = f.SubFolders
Set nf = fc.Add("Ravi Folder")

Dim fso, fldr
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.CreateFolder("C:\MyTest")

Accessing the Object's Properties
---------------------------------
Set fldr = fso.GetFolder("c:\")
Msgbox fldr.Name

Dim fso, f1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.GetFile("c:\detlog.txt")
MSGBOX f1.DateLastModified, DateLastAccessed, DateCreated,

f.Drive - Returns the drive letter of the drive
f.Type - Returns information about the type of a file or folder. For example, for files ending in .TXT, "Text Document" is returned.
f.size - returns the size in bytes
f.Path - Returns the path for a specified file, folder, or drive.
f.ParentFolder - Returns the folder object for the parent of the specified file or folder.
f.IsRootFolder - Returns True if the specified folder is the root folder; False if it is not.

Listing all the files
---------------------
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & "
"
Next

Listing all sub folders
-----------------------
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 in fc
s = s & f1.name
s = s & "
"
Next

Display Level Depth
-------------------
Dim fso, f, n
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(pathspec)
If f.IsRootFolder Then
DisplayLevelDepth = "The specified folder is the root folder."
Else
Do Until f.IsRootFolder
Set f = f.ParentFolder
n = n + 1
Loop
MsgBox "The specified folder is nested " & n & " levels deep."
End If

Working with Files
------------------
Creating Files:-
Dim fso, f1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.CreateTextFile("c:\testfile.txt", True)
OR
Dim fso, ts
Const ForWriting = 2
Set fso = CreateObject("Scripting. FileSystemObject")
Set ts = fso.OpenTextFile("c:\test.txt", ForWriting, True)
OR
Dim fso, f1, ts
Const ForWriting = 2
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateTextFile ("c:\test1.txt")
Set f1 = fso.GetFile("c:\test1.txt")
Set ts = f1.OpenAsTextStream(ForWriting, True)

Adding Data to the File:-
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("c:\testfile.txt", True)
tf.WriteLine("Testing 1, 2, 3.") 'Writes in New Line
tf.WriteBlankLines(3)
tf.Write ("This is a test.")
tf.Close

Reading Files:-
Const ForReading = 1
Set ts = fso.OpenTextFile("c:\testfile.txt", ForReading)
s = ts.ReadLine ' Other Methods Read, ReadAll
MsgBox "File contents = '" & s & "'"
ts.Close

Moving, Copying, and Deleting Files:-
Dim fso, f1, f2, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.CreateTextFile("c:\testfile.txt", True)
f1.Write ("This is a test.")
f1.Close

Set f2 = fso.GetFile("c:\testfile.txt")
Move the file to \tmp directory.
f2.Move ("c:\tmp\testfile.txt")
' Copy the file to \temp.
f2.Copy ("c:\temp\testfile.txt")

' Get handles to files' current location.
Set f2 = fso.GetFile("c:\tmp\testfile.txt")
Set f3 = fso.GetFile("c:\temp\testfile.txt")
' Delete the files.
f2.Delete
f3.Delete

Delete File / Folder
--------------------
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

fso.DeleteFile(filespec)
fso.DeleteFolder(filespec)

fso.MoveFile Drivespec, "c:\windows\desktop\"
fso.MoveFolder Drivespec, "c:\windows\desktop\"


FileSystemObject.CopyFile "c:\mydocuments\letters\*.doc", "c:\tempfolder\"
FileSystemObject.CopyFolder "c:\mydocuments\letters\*", "c:\tempfolder\"

File/Folder Exist
-----------------
Set objFso = CreateObject("Scripting.FileSystemObject")

If objFso.FolderExists(strFolderPath)

If objFso.FileExists(strFilePath)

QTP Compare Excel Sheets

Compare any two excel sheets, each cell by cell

This code will open two excel sheet(s) and compare each sheet, cell by cell. If there are any changes in cell(s) , it will highlight the cell in red color in the first sheet.

Set objExcel = CreateObject(”Excel.Application”)
objExcel.Visible = True
Set objWorkbook_1= objExcel.Workbooks.Open(”C:\Doc1.xls”)
Set objWorkbook_2= objExcel.Workbooks.Open(”C:\Doc2.xls”)
Set objWorksheet1= objWorkbook_1.Worksheets(1)
Set objWorksheet2= objWorkbook_2.Worksheets(1)

For Each cell In objWorksheet1.UsedRange
If cell.Value <> objWorksheet2.Range(cell.Address).Value Then
cell.Interior.ColorIndex = 3 'Highlights the specific cell in red color if any changes in cells
Else
cell.Interior.ColorIndex = 0
End If
Next
set objExcel=nothing

Open SSL Certificate Creation

1.Get the Windows distribution of OpenSSL: http://www.slproweb.com/products/Win32OpenSSL.html

Note: ISS does not have any affiliation with the windows OpenSSL project, and does not support it's use or take responsibility for anything that occurs from it's use.

2.Install it.
3.Open a command prompt and cd to OpenSSL\bin -You will need to run these 3

commands:
1. openssl req -config openssl.cfg -new -out server-rsa.csr- Press Enter.
2. Enter a passphrase. It is not restricted. Remember this for an upcoming step. Press Enter.
3. Enter your complete location information. Press Enter.
Do NOT enter a challenge password. Leave this blank. Press Enter.
You do not need to enter an optional company name. Press Enter.
4. openssl rsa -in privkey.pem -out server-rsa.key - Press Enter.
5. Enter your passphrase from the previous step. Press Enter.
6. openssl x509 -in server-rsa.csr -out server-rsa.crt -req -signkey server-rsa.key -days 3650 – Press Enter.

This will generate a server-rsa.key and server-rsa.crt file in the OpenSSL\bin folder. On the SiteProtector server, stop the SiteProtector WebServer service. Make a backup of the \Application Server\webserver\Apache2\conf\ssl.key\server-rsa.key and \ssl.crt\server-rsa.crt.

Replace those with the ones generated in earlier steps and then start the web server service.

About iTKO LISA and features

About iTKO LISA :
LISA - is next generation tool, which helps in automating and also to test wide variety of applications. Not only GUI application but also middle-tier applications too. Which helps in identifying the application or environment or network issues. It helps a lot in cloud environment to troubleshoot real time problems.

Purpose - Lower the Cost of Quality with Complete and Automated Test Coverage.

LISA Test - is a complete and collaborative automated testing solution designed for Cloud applications and other distributed application architectures that leverage SOA, BPM, and integration suites.

LISA Test - Its a codeless testing environment allows QA, Development and others to rapidly design and execute automated unit, functional, regression, system integration, load, and performance tests.

LISA Test can dramatically reduce the cost of quality, and provides industry leading capabilities to test Rich Internet Application UIs and heterogeneous middle-tier technologies that are pervasive in today's distributed applications.

Challenge :
Enterprise applications are becoming more complex, distributed, and heterogeneous. Application business logic is no longer found only in the UI and the database (as in client/server), but now extends across multiple middle tiers and technologies. This is further complicated when applications consume underlying services from third-parties, or use highly interactive presentation layer technologies, such as Flash, Flex, DHTML, AJAX, Swing, ActiveX, and others.
Organizations are also implementing more agile development methods and distributed teams. Yet, use of shareable, reusable test assets between these teams is limited or non-existent. Different tools are often employed, such as code-based unit testing tools for developers that are unusable by QA; and functional UI testing that does not translate errors into repeatable defects for developers to catch bugs earlier.

Distributed application quality can only be ensured when every layer of the application is tested and verified throughout the software lifecycle. This requires a much higher degree of test automation and collaboration among stakeholders.

The Solution: Complete and Collaborative Testing
LISA Test provides complete test coverage, with the ability to invoke and verify the behavior of each component across the end-to-end application. LISA provides automated testability for all of the components in the technology stack. Out of the box, LISA provides industry-leading standards support, with native integration to most J2EE servers, integration suites, and ESBs. LISA's Software Development Kit provides extensibility features to bring testability to any custom or proprietary components with minimum cost and effort.

LISA Test also builds portable, executable test cases that are easy to extend, easy to chain into workflows with other tests, and simple to integrate with existing test repositories. LISA test cases are designed to be shared across different teams and environments, with the ability to easily attach prior results and artifacts to extend them, and the ability to readily execute with different underlying data.

LISA Features:
1. Complete Test Coverage for Heterogeneous, Distributed Architectures: In a single test environment, LISA invokes and verifies functionality at every layer of the application - from dynamic web UIs, to web services, ESB/JMS messaging layers, EJB servers, Java objects, databases, file systems, legacy objects and much more.
2. Codeless Testing: There are no test scripts to write and maintain in LISA. Developers and non-developers can collaborate with high productivity, including testing "headless" middle-tiers that have no user interface.
3. Next Generation UI Testing: Record testing sessions in the latest UI technologies, and convert them to versatile automated tests that maintain identity and security context and automatically adapt to positional and underlying content changes.
4. Load and Performance Testing: LISA easily extends functional tests for load and performance testing to make test coverage more efficient, and to load test individual components earlier in the lifecycle.
5. Advanced Reporting: LISA provides robust, interactive dashboards with real-time and historical performance results, functional metrics, data filtering, and reports.
6. Integrate with Existing Management Tools: LISA test cases are easily stored and launched as executable test assets alongside your Source Code and Requirements Management, Build, Issue tracking, or Test Mgmt tools (including HP Quality Center and IBM Rational Quality Manager).

LISA Test Benefits:
LISA Test can help your organization in:
1. Lower testing cycle times and costs with end-to-end automation that can significantly reduce or eliminate manual testing efforts.
2. Increase the number of function points you can confidently release without increasing resources or team size.
3. Automate regression testing to dramatically reduce labor costs and improve time-to-market.
4. Expand test scenarios to catch more bugs earlier and improve quality.
5. Improve productivity by reusing test assets and expanding collaborative testing across the lifecycle.
 

©2010 Software Testing powered by Free Blogger Templates | Author : Anand Satish