15 March 2016

Execute stored procedure in oracle database from powershell

 $connectionString =“User Id=username;Password=password;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=appname.domain.intra)(PORT=1523)))(CONNECT_DATA=(SID=sid)))”;

$oracleConnection = new-object System.Data.OracleClient.OracleConnection($connectionString);
$ProcName = "procedure_name";
$cmd = new-object System.Data.OracleClient.OracleCommand;
$cmd.Connection = $oracleConnection;
$cmd.CommandText = $ProcName;
$cmd.CommandType = [System.Data.CommandType]::StoredProcedure;

04 February 2016

Ldap filter for deleted objects

to get all deleted computer accounts:

Get-ADObject -LDAPFilter "(&(ObjectClass=computer)(isDeleted=*))" -IncludeDeletedObjects -Server servername

19 January 2016

Ldap filter enabled users


for disabled users:


09 January 2016

Windows buit-in checksum utility

certutil -hashfile pathToFileToCheck MD5

it can also calculate for MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512

08 January 2016

Graphical User Interface for PowerShell scripts

We have two options for creating a GUI for a PowerShell script:
  • Windows Forms (WinForms)
  • Windows Presentation Foundation (WPF)
WinForms use only native Windows interface elements - limited control on how things will look like.

With WPF you have full freedom of design but it's way more complicated than WinForms.
WPF is built on DirectX - this provide hardware acceleration and also enables modern UI features like transparency, gradients and transforms.

Also WPF offers a new markup language alternative - XAML - a different means of defining UI elements. An application that is defined as WPF is able to be deployed on the desktop or hosted on a webserver.

WinForms are events driven.