Thursday, December 27, 2012

Importance of Audit in Windows Servers

From - http://www.techotopia.com/index.php/Auditing_Windows_Server_2008_File_and_Folder_Access

Importance of Folder and File Auditing to track changes on Windows Servers.   If something gets change that your job requires you to be responsible, it is to your benefit to:

A) Lock down and password protect and minimize the password to (3) people only
B) Turn File Auditing on.  
C) Ensure that the only change capability is assigned to individuals rather than a service account.  If a service account is compromised you will not know be able to track the changes down.

Thursday, December 20, 2012

How to write efficient database JOINs


How to write efficient database JOINs
Last updated March 27, 2009. Created by moshe weitzman on June 21, 2003.
Edited by bekasugkallenbergpureginStevenLog in to edit this page.
This page is based on an e-mail posted by Craig Courtney on 6/21/2003 to the drupal-devel mailing list.
There are 3 kinds of joins: INNER, LEFT OUTER, and RIGHT OUTER. Each requires an ON clause to let the RDBMS know what fields to use when joining the tables. For each join there are two tables: the LEFT table and the RIGHT table. The syntax is as follows:
{left table} (INNER | LEFT OUTER | RIGHT OUTER) JOIN {right table} ON (join criteria)
An INNER JOIN returns only those rows from the LEFT table having a matching row in the RIGHT table based on the join criteria.
A LEFT OUTER JOIN returns all rows from the LEFT table even if no matching rows where found in the RIGHT table. Any values selected out of the RIGHT table will be NULL for those rows where no matching row is found in the RIGHT table.
A RIGHT OUTER JOIN works exactly the same as a LEFT OUTER JOIN but reversing the direction. So it would return all rows in the RIGHT table regardless of matching rows in the LEFT table.
It is recommended that you not use RIGHT OUTER JOIN since a query can always be rewritten to use LEFT OUTER JOIN which tends to be more portable and easier to read.
If there are multiple rows in one table that match one row in the other table, the join will return that same row many times.
For example:
Table A
tid, name
1, 'Linux'
2, 'Debian'
Table B
fid, tid, message
1, 1, 'Very Cool'
2, 1, 'What an example'
Query 1: SELECT a.name, b.message FROM a INNER JOIN b ON a.tid = b.tid
Result 1:
Linux, Very Cool
Linux, What an example
Query 2: SELECT a.name, b.message FROM a LEFT JOIN b ON a.tid = b.tid
Result 2:
Linux, Very Cool
Linux, What an example
Debian, NULL
Visual Examples
codinghorror.com example

Hope that helps in reading some of the queries.

Monday, December 03, 2012

SQL Data Cache

http://msdn.microsoft.com/en-us/library/ms178604(v=vs.100).aspx Very good stuff. Cache data, but poll SQL Server for changes. Read the article above. http://www.codeproject.com/Articles/144344/Query-Notification-using-SqlDependency-and-SqlCach Service Broker issue http://msdn.microsoft.com/en-us/library/ms188798.aspx

Tuesday, November 20, 2012

SortedDictionary Powerful tool

Dim CheckSecurity As ctrl_secure = ctrl_secure Dim bValue As Boolean Dim dic As SortedDictionary(Of String, Int32) = CType(Session("UserAuthorizations"), SortedDictionary(Of String, Int32)) If ((dic.ContainsKey("A")) And (dic.Item("A") > 1)) Or ((dic.ContainsKey("B")) And (dic.Item("B") > 1)) Then bValue = True End If

Thursday, November 15, 2012

Here are five questions great candidates ask:

Here are five questions great candidates ask:

What do you expect me to accomplish in the first 60 to 90 days?

Great candidates want to hit the ground running. They don't want to spend weeks or months "getting to know the organization."

They want to make a difference--right away.


What are the common attributes of your top performers?

Great candidates also want to be great long-term employees. Every organization is different, and so are the key qualities of top performers in those organizations.


Maybe your top performers work longer hours. Maybe creativity is more important than methodology. Maybe constantly landing new customers in new markets is more important than building long-term customer relationships. Maybe it's a willingness to spend the same amount of time educating an entry-level customer as helping an enthusiast who wants high-end equipment.


Great candidates want to know, because 1) they want to know if they fit, and 2) if they do fit, they want to be a top performer.


What are a few things that really drive results for the company?


Employees are investments, and every employee should generate a positive return on his or her salary. (Otherwise why are they on the payroll?)


In every job some activities make a bigger difference than others. You need your HR folks to fill job openings... but what you really want is for HR to find the rightcandidates because that results in higher retention rates, lower training costs, and better overall productivity.


You need your service techs to perform effective repairs... but what you really want is for those techs to identify ways to solve problems and provide other benefits--in short, to generate additional sales.


Great candidates want to know what truly makes a difference. They know helping the company succeed means they succeed as well.


What do employees do in their spare time?


Happy employees 1) like what they do and 2) like the people they work with.


Granted this is a tough question to answer. Unless the company is really small, all any interviewer can do is speak in generalities.


What's important is that the candidate wants to make sure they have a reasonable chance of fitting in--because great job candidates usually have options.


How do you plan to deal with...?


Every business faces a major challenge: technological changes, competitors entering the market, shifting economic trends... there's rarely a Warren Buffett moat protecting a small business.


So while a candidate may see your company as a stepping-stone, they still hope for growth and advancement... and if they do eventually leave, they want it to be on their terms and not because you were forced out of business.


Say I'm interviewing for a position at your bike shop. Another shop is opening less than a mile away: How do you plan to deal with the new competitor? Or you run a poultry farm (a huge industry in my area): What will you do to deal with rising feed costs?A great candidate doesn't just want to know what you think; they want to know what you plan to do--and how they will fit into those plans.

Monday, November 12, 2012

XML Transformation on MSBuild TFS 2010

Many thanks to http://kjdaly.com/Blog/Details/5 Blog ----


<Target Name="BeforeBuild">
</Target>
<!--<Target Name="AfterBuild">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
</Target>
-->    <Target Name="AfterBuild" Condition="$(IsAutoBuild)=='True'">
     <ItemGroup>
     <DeleteAfterBuild Include="$(WebProjectOutputDir)\Web.*.config" />
    </ItemGroup>
    <TransformXml Source="Web.config" Transform="$(ProjectConfigTransformFileName)" Destination="$(WebProjectOutputDir)\Web.config"/>
   <Delete Files="@(DeleteAfterBuild)" />
  </Target>
</Project>

Assuming you have saved and checked in your project file and are in the process of creating a build definition, on the Process step of your build definition you will find under the Advanced heading a field labeled “MSBuild Arguments”. Enter the value /p:IsAutoBuild=”True”.

Simple GOTCHA, be sure to check in the PROJECT File back to Source Control before testing (DUH!)

Tuesday, October 09, 2012

SQL Connection and Command Example

Private Function IsClientAdmitted(ClientID As Integer) As BooleanDim conn As SqlConnectionDim cmd As New SqlCommandDim passOrFail As StringpassOrFail = Falseconn = New SqlConnection(ConfigurationManager.ConnectionStrings("conn_string").ConnectionString())
Trycmd.CommandText = "csp_validate_progress_notes_entry"cmd.CommandType = CommandType.StoredProcedurecmd.Connection = conn
cmd.Parameters.Add(
"@ClientID", SqlDbType.Int).Value = ClientIDcmd.Connection.Open()
passOrFail = cmd.ExecuteScalar()

Return passOrFail
Catch ex As ExceptionRaiseEvent StatusMessageChanged(New StatusMessageEventArgs("Error Connecting to Database", StatusMessageEventArgs.StatusMessageType.ErrorMsg))
Return passOrFail
FinallyIf Not conn Is Nothing Thenconn.Close()End IfEnd TryEnd Function

Friday, September 28, 2012

Auther - http://www.windowsitpro.com/article/windows-server/top-10-remote-desktop-keyboard-shortcuts

10. Ctrl+Alt+plus sign (+)—Dealing with capturing screen images from a Remote Desktop session can be a mystery. If you press Print Screen, you get an image of your local desktop—not the remote desktop. Pressing the Ctrl+Alt+plus sign (+) keyboard shortcut captures a snapshot of the entire client window area of Remote Desktop and is the same as pressing Print Screen on your local desktop.
9. Ctrl+Alt+minus sign (-)—Sometimes you don't want an image of the entire desktop; sometimes you want just a selected window. Pressing the Ctrl+Alt+minus sign (-) keyboard shortcut captures a snapshot of just the active window within the remote desktop session. This key combination is the same as pressing Alt+Print Screen on your local desktop.
8. Alt+Home—Pressing the Alt+Home keyboard combination with Remote Desktop displays the Start menu on the remote system. The Start menu gives you quick access to the different programs installed on the remote system. This key combination is the same as pressing the Windows key on your local desktop.
7. Alt+Delete—Pressing the Alt+Delete keyboard combination in the Remote Desktop session opens the Windows menu of an application running on the remote system. The Windows menu is typically displayed under the icon in the extreme upper left corner of most Windows applications, and it lets you move and resize the application.
6. Ctrl+Alt+Break—Sometimes you might want the Remote Desktop window to be displayed in full-screen mode just as if you were using your local desktop. If you want to toggle the Remote Desktop session between a window and a full-screen display, you can press the Ctrl+Alt+Break keyboard combination.
5. Ctrl+Alt+Pause—Like the previous item, the Ctrl+Alt+Pause keyboard combination switches between full screen and windowed mode. However, with this keyboard shortcut, the remote desktop window remains at its standard size and doesn't fill the entire local desktop. Instead, it's displayed on a black background.
4. Alt+Insert—Sometimes you want a quick way to switch between the different programs that you have running. Pressing the Alt+Insert keyboard combination lets you cycle through the programs on the remote system in the order that they were opened. This process is the same as using Alt+Tab on your local desktop.
3. Alt+Page Down—Another way to cycle through the running programs on your Remote Desktop session is to use the Alt+Page Down keyboard shortcut. Pressing this key combination lets you switch between programs on the remote desktop session, moving from right to left in the Windows task switcher. This is the same as Alt+Shift+Tab on your standard desktop.
2. Alt+Page Up—Pressing Alt+Page Up lets you switch between programs on the Remote Desktop session, moving from left to right in the Windows task switcher. This is the same as Alt+Tab on your standard desktop.
1. Ctrl+Alt+End—One of the most common yet hard-to-find things that you'll need to do in a Remote Desktop session is to send a Ctrl+Alt+Del signal to the remote system. Press Ctrl+Alt+End if you need to send a Ctrl+Alt+Del keystroke combination to the remote system. This keystroke opens the Microsoft Windows Security dialog box, which lets you lock the computer, log off, change your password, and start Task Manager.

Monday, June 18, 2012

SharePoint 2010 User Profile Synchronization

Know the difference between FQDN and NETBIOS, before configuring SharePoint 2010 User Profile application be sure to know which one you need to use before setting up the Profile Application, because once setup you will have to delete the current application and perform a brand new full import.

http://blogs.msdn.com/b/russmax/archive/2010/03/20/sharepoint-2010-provisioning-user-profile-synchronization.aspx