IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Quickly Query LDAP in Visual Studio SSIS

At times, you need to do a quick query against LDAP, but if your access is quite restricted, sometimes instead of using SQL Server Management Studio, you can also use SSIS Project within Visual Studio to do it.

Steps

  1. Launch Visual Studio.

  2. Create a new project and double-click on Integration Services Project.

    Visual Studio New Integration Services Project

  3. Name your Project name (e.g. ITNotaQueryLDAP), then click Create button.

    Visual Studio Configure New Integration Services Project

  4. For this exercise, we use the default Package.dtsx. If it’s not opened by default, just double click it on the right pane window.

  5. Drag Data Flow Task from SSIS Toolbox window to the Control Flow window.

    Add Data Flow Task to Control Flow in SSIS

  6. Now we want to add a Connection Manager by right-clicking on a blank area under Connection Managers pane and select New ADO.NET Connection….

    Add a new ADO.NET Connection in SSIS Connection Managers

    A smaller window titled Configure ADO.NET Manager will pop up, click on the New button.

    Create a new OLE DB Connection Manager in SSIS

  7. In a Connection Manager window, for the Provider, select OLE DB Provider for Microsoft Directory Services (under .Net Providers for OleDb). Then, click OK.

    OLE DB Provider for Microsoft Directory Services - .Net Providers\SqlClient Data Provider in SSIS

  8. Once you’re back in Connection Manager window, click on the Test Connection button. Make sure you see the Test connection succeeded screen. Click both OK buttons.

    SSIS Test Connection Manager (Successful)

  9. After you clicked OK, you can see the configuration summary of your SSIS connection. Click OK again.

    SSIS Connection Manager Configuration Summary

  10. At this point, you have a Data Connection in your Connection Managers which you can rename to LDAP Data Connection.

    Rename Connection Manager to LDAP Data Connection in SSIS

  11. Next, you can either double-click on the Data Flow Task or click on the Data Flow tab and drag ADO NET Source from the left pane, under Other Sources.

    Double click on the ADO NET Source box, and select the LDAP Data Connection for ADO.NET connection manager:, SQL command for Data access mode: and use the following SQL command as an example under SQL Command text:.

    LDAP://DC=ITNota,DC=Corp,DC=com;(&(objectCategory=Person)
    (SN=Smith));SN,givenName,displayName,
    mailNickName,sAMAccountName,mail,msExchHideFromAddressLists,
    homeMDB;subtree
    

    This query specifically looks for all records for anyone with a last name of “Smith” in the domain. You need to replace the values of the DCs to your own domain and also the search string (Smith) to make it work in your situation. Click Preview button.

    SSIS ADO NET Source Editor with LDAP Query

  12. Once you clicked Preview button, You should see the first 200 rows.

    Preview of LDAP Query in SSIS

That’s all there is to it.

Of course, there’s a caveat of using this as you can only view the first 200 rows of your result. This is not intended to be used as a solution of any deployment other than a workaround when you are limited with what you can access and you need to find a few records from your LDAP/Domain Services.

January 7, 2022 Filed Under: How To Tagged With: ActiveDirectory, ETL, Microsoft, SSIS

Basic Security Practice with Password

After one client was notified that her passwords were found in a data leak and may compromise the accounts from her iPhone:

iPhone warning for compromised passwords

Compromised...

Some of your passwords have appeared in a data leak, putting those accounts at high risk of compromise. iPhone can help...

It turns out, other than the password was to easy to guess, it was also due to password reuse. Of course the immediate action you need to take is to follow its recommendations to change all the affected passwords.

iPhone security recommendations for compromised passwords

But what needs to be explored further is why people still use the same password for their accounts although it’s been proven that this cause more damage when they get hacked. This issue stems from the fact that most non-technical people still resort to using memory to store their passwords, so they’re limited to either one short, easy to guess password or a bit more complicated one but then it’s used in every other accounts or even worse short and easy and reused everywhere. It bears repeating that this is a really dangerous practice, so we need to stop using the same password for two or more accounts.

So if we need to have a unique password for each account, it will be overly difficult (if not impossible) to create those passwords, much less memorizing them. That’s where a password manager comes handy.

Although password manager is already in use for a long time, there’s still a big gap between the technical and non-tech people. The latter, even if they have the password manager installed, still hesitate to use it, just because old habit dies hard or maybe they feel intimidated to try something new.

Nobody should feel intimidated using a password manager. If anything, using a password manager can actually make your life easier.

Here’s a simple way to get started. In this post, we’ll use 1Password as our password manager of choice. However, this is not the only one available. You can always choose your own password manager that suits your need. The principle is going to be the same.

By using a password manager, instead of memorizing so many easy-to-guess passwords, you just need to create one long passphrase and use that as your “master key” that you need to guard closely.

To increase the security of the master password, make that a passphrase that is easy to remember and makes sense to you. For example, you can use an unusual sentence such as, “What book do I like? The answer is Romeo and Juliet.” It is really up to you whether you want to use punctuation, capitalization or not. The point is, the more complex it is, the better as long as you can remember it.

Once you decided on the master password, install 1Password app (both on your phone and PC). If you want to make it even easier, don’t forget to install the browser extensions.

One useful shortcut to remember is CTRL + \ for Windows (or Command + \ on Mac) that you can use to enter your user id and password on a login page. But in order to use this feature, you need to have your 1Password unlocked first. Otherwise, 1Password will ask you to type in your master password to open it first.

Further Reading

“This password has appeared in a data leak” notice on iPhone
Get started with 1Password
Copy and fill passwords into apps that don’t work with 1Password

December 1, 2021 Filed Under: How To Tagged With: Information Security

How to Fix Failed to Decrypt Protected XML Node Error in SSIS

One morning, you discovered your SSIS package failed to run with the following error message:

Started: 5:00:03 AM
Error: 2021-10-08 05:00:04.62
Code: 0xC0016016
Source: SSIS_Package_ITNota
Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
End Error

This is typically caused by a simple setting that is too often overlooked during deployment.

In general, you do not want to save any connection ID and password in your package so you can inject the value from variables that you store either in a database or if you use a Package Deployment Model, then in an XML saved in the *.dtsConfig file.

So what you want to do before you build the package for PROD deployment, you want to set the package property Protection Level to DontSaveSensitive and you set all the values for your variables in your configuration file.

Steps to Set SSIS Package Property Level

  1. With your SSIS package opened, under the Control Flow tab, on a blank area, right-click your mouse and select Properties or press ALT+ENTER.

  2. Under Properties, go to Security, and look for ProtectionLevel. Check the value. By default, it’s set to EncryptSensitiveWithUserKey.

    SSIS Package Properties under Control Flow Tab

    The ProtectionLevel should be set to DontSaveSensitive.

    SSIS Package Properties Security Protection Level

Save the package and if the configuration is already setup, it’s ready to be deployed.

Further Reading

Failed to decrypt protected XML node “DTS:Password” with error 0x8009000B “Key not valid for use in specified state”

November 1, 2021 Filed Under: How To Tagged With: ETL, Microsoft, SSIS

Basic Configuration in Git

After installing Git, you may want to do some basic configuration so you can have a proper versioning history and collaborate with others in a shared repository.

First thing, you want to do before anything is to set your name and email.

You can open Git Bash on Windows or Terminal for macOS.

Replacing the First, Last and email address with your own, type the following:

git config --global user.name "First Last"
git config --global user.email [email protected]

This will be useful when you collaborate with others to see who has made what changes in the repository.

The next one, you want to set how the end of the line is treated in Git. This is often overlooked by many and usually does not pose any issues if everyone uses the same system or you just use Git by yourself. However if you check in and out your code using different platforms, it can cause an issue.

A bit of explanation with the end of the line for each OS here. On Windows an end of line consists of two characters \r\n which is a carriage return followed by a line feed. macOS on the other hand, only uses \n (line feed) and no carriage return. As such, whenever someone checks code in or out, Git needs to know how to treat the line ends so everyone will have consistent experience. So we have to configure the core.autocrlf accordingly.

Windows

For Windows, typically when you accept default settings from Git installer, it will set it automatically to true. But just in case you checked the wrong option or you wanted to be sure, you can configure it manually.

Type the following in Git Bash:

git config --global core.autocrlf = true

macOS

For macOS, type the following in Terminal:

git config --global core.autocrlf = input

Git global config for core.autocrlf in macOS Terminal

Now you can verify all your configuration settings by typing this command:

git config --global --list

If you found any typo, you can always fix it by running the same command line with the correct information.

That’s it. This configuration typically is done just once.

Next, while optional, you might want to check this post if you want to use your favorite text editor as the default.

Further Reading

How to Use Your Favorite Text Editor in Git
Git git-config Documentation
How to Install Git

October 14, 2021 Filed Under: How To Tagged With: Git

How to Install Git

This may be a very basic topic, but it turned out to be very useful for people who are just starting to delve into version control software.

Just a quick overview from Pro Git book by Scott Chacon and Ben Straub that you can download from the link at the bottom of this post, this would give you a clearer explanation on why you should use it.

What is “version control”, and why should you care? Version control is asystem that records changes to a file or set of files over time so thatyou can recall specific versions later. For the examples in this book,you will use software source code as the files being version controlled,though in reality you can do this with nearly any type of file on acomputer.

If you are a graphic or web designer and want to keep every version of an image or layout (which you would most certainly want to), a Version Control System (VCS) is a very wise thing to use. It allows you to revert selected files back to a previous state, revert the entire project back to a previous state, compare changes over time, see who last modified something that might be causing a problem, who introduced an issue and when, and more. Using a VCS also generally means that if you screw things up or lose files, you can easily recover. In addition, you get all this for very little overhead.

Now we can go back to the practical side of it on how to install it.

Windows

If you’re on Windows, the simplest thing to do is just head on to this link and download latest version of Git exe file.

Git download page for Windows

Run the exe and follow the instructions, then you’re done.

While it’s outside the scope of this post, you can also install Git from Visual Studio by checking the options when you install it. My personal preference though is to install Git separately and you can still access it from Visual Studio.

macOS (or Linux)

For Mac users, by default, you already have Git installed in your system, you just need to access it from the Terminal. The most common issue is the version of Git that’s installed is not the latest one. It’s certainly not a big issue if you’re just starting, but if you want to keep updating your Git to the latest version, you need to install your own.

You can check which version of Git you have by typing the following command in Terminal:

git --version

You can certainly download your own Git from as well, but I think the best way to do it is to install it using Homebrew package manager for macOS (or Linux).

Just install it from the Terminal by copying the command line on their page by clicking the notepad icon on the right. Then you can paste that command on your Terminal.

Homebrew Package Manager installation page

Once you have Homebrew installed, you can open your Terminal and type the following:

brew install git

That’s it.

You can run the command line again to verify if your default Git is replaced with the latest version that was installed from Homebrew:

git --version

Now you’re almost ready to use Git. Check on how to do a basic configuration in Git before we can use it.

Further Reading

Basic Configuration in Git
How to Use Your Favorite Text Editor in Git

Download

Git

References

Pro Git (FREE eBook)
Homebrew The Missing Package Manager for macOS (or Linux)

October 11, 2021 Filed Under: How To Tagged With: Git

« Previous Page
Next Page »
Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure