PowerShell script to send activation link emails for Forgot Password or Reset Password requests

PowerShell script to send activation link emails for Forgot Password or Reset Password requests Scenario: We know there are plenty number of web sites online and almost all of them will have a user login page with support for “Forgot Password”/”Reset Password” option.  Considering it such a basic functionality, whatif this “Forgot Password”/”Reset Password” request email system has issues and you want to setup an automation script in the interim.  This script will address such a requirement and can come handy for most of the web developers. Requirement Specifications: A Powershell script that Runs on a Windows Server 2008 x64 […]

Read more

PowerShell: Connecting and Querying Oracle DataBase contents from a Windows 7 x64 system, Display results row by row

Important points to consider from the environment of this automation: Your base Windows is a x64 bit OS Your remote Oracle DB is of a x64 bit version on a x64 system You install Oracle Client which is available ONLY in x86 version Thus, your DSN to Oracle client is as well a x86 version, can be viewed in C:WindowsSysWOW64odbcad32.exe Thus, you can connect to your Oracle from a x86 applications only by using the Oracle Client driver Thus, you need to run your PowerShell script from x86 version only: "C:Windowssyswow64Windowspowershellv1.0powershell.exe" Configuring DSN to Oracle DB on Windows 7 x86: […]

Read more

FIX: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed

Environment: You are on a Windows 7 x64 bit System Using PowerShell x64 bit Authoring a script that connects to Oracle Database via "System.Data.OracleClient" Sample Script: $connectionString = "Data Source=ORADB01.TESTLAB.LAN;User Id=root;Password=R00tUs3r;Integrated Security=no" $queryString = "select * from users where username like ‘%govardhan%’" [System.Reflection.Assembly]::LoadWithPartialName("System.Data.OracleClient") | Out-Null $connection = New-Object System.Data.OracleClient.OracleConnection($connectionString) $command = new-Object System.Data.OracleClient.OracleCommand($queryString, $connection) $connection.Open() $resources = $command.ExecuteReader() # Write out the results while ($resources.read()) {     $Process=$resources.GetDecimal(0)     $Status=$resources.GetString(1)     Write-Host $Process $Status     } $connection.Close()   Output:   PS C:>Powershell C:tempSend-Activation-Emails.ps1 Exception calling "Open" with "0" argument(s): "Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will […]

Read more