LDAP Queries Continue

As in my prior post I mentioned how to retrieve the LDAP url and primary server and port for queries I found also the need to identify the path to a particular active directory object, lets say, I have a group name but I need to find the LDAP id for it, how can I do that?

We’ll, I have found an implementation on Excel (if you search for the code you will find several examples with the same thing)

I don’t remember where I found the code from, so I can’t provide a link to the source but here it is:

Function getLDAPName(ByVal SearchField As String, ByVal SearchString As String, ByVal ReturnField As String)
‘Declare Variables
Dim objAdoCon, objAdoCmd, objAdoRS
Dim objUser, objRootDSE
Dim strDomainDN, strUserFullName
Dim intAnswer As Integer
On Error GoTo Err_NoNetwork

‘ Get the DN of the user’s domain
Set objRootDSE = GetObject(“LDAP://rootDSE”)
strDomainDN = objRootDSE.Get(“defaultNamingContext”)

‘ Search the domain for the user’s account object
Set objAdoCon = CreateObject(“ADODB.Connection”)
objAdoCon.Open “Provider=ADsDSOObject;”

Set objAdoCmd = CreateObject(“ADODB.Command”)
Set objAdoCmd.ActiveConnection = objAdoCon

objAdoCmd.CommandText = _
“SELECT ADsPath,samAccountName FROM ‘LDAP://” & strDomainDN & “‘ WHERE ” & _
“objectCategory=’person’ AND objectClass=’user’ AND ” & _
SearchField & “='” & SearchString & “‘”

‘ “DisplayName='” & clockNumber & “‘”
‘ “sAMAccountName='” & clockNumber & “‘”

Set objAdoRS = objAdoCmd.Execute

‘ If found, get the displayName attribute.

If (Not objAdoRS.EOF) Then
Set objUser = GetObject(objAdoRS.Fields(“ADsPath”).Value)

objUser.GetInfoEx Array(ReturnField), 0
getLDAPName = objUser.Get(ReturnField)

Set objUser = Nothing

Else
‘ handle “not found” error here
GoTo Err_NoNetwork
End If

Set objAdoRS = Nothing
Set objAdoCmd = Nothing
objAdoCon.Close
Set objAdoCon = Nothing

Set objRootDSE = Nothing
Set WshNetwork = Nothing
GoTo Exit_Sub

Exit_Sub:
Exit Function

Err_NoNetwork:
getLDAPName = “Error”
GoTo Exit_Sub
End Function

The most important detail in this code, is the Active directory query. (you can find a list of available properties in this link)

for example in the following query

select cn from LDAP://[LDAP URL] WHERE objectCategory=’group’ and cn=’MyGroupName’

(*Update): When you are querying for a name and you need to filter on a partial string (LIKE statement) you can use the ‘*’ so ‘MyGro*’ will look for anything starting with MyGro and ‘M*yGroupName’ will search for anything with starting M and anything between the yGro.

What I am looking for is the common name of the MyGroupName, and a list of properties can be specified (the full list on the link above)

but If you change the specific attribute for a ‘*’ interestingly enough you won’t get all parameters (as a sql query would) but you receive the full LDAP object name in the value field.

The query  highlighted in blue uses * to search for a group:

WatchWindow

As you can see the value field lists the entire tree to find the object

You can review the objec with little more detail (using the immediate window)

immediateWindow

so, as you can see in this post, you can find a lot of detail for an account or group on active directory using any VBA tool available to you (instead of having to download extra tools)

 

Active Directory (finding LDAP information)

While trying to find how to connect a J2EE server with active directory I came to realize how little information I had on the domain controller, as I am no Domain administrator nor I have admin access on any machine, trying to figure out this information was just not doable, unless I installed a tool… or so I thought.

Here comes internet to the rescue, and here it is:
1) find out your domain, a simple IPCONFIG /ALL is what we need.
from there the Connection-specific DNS Suffix . will provide that information.
2) Next we need to identify who is our LDAP preferred server.
so we go to nslookup in a command prompt window to query that information.
in nslookup we set:

set type=all
> _ldap._tcp.dc._msdcs.[place domain name here from DNS Suffix]
and bam! you have the port used and the LDAP collection of servers you can use.

Sample output:
on-authoritative answer:
ldap._tcp.dc._msdcs.XXXXX.ad.XXXX.com SRV service location:
priority = 0
weight = 100
port = 389
svr hostname = XXservernameXX.XXX.ad.XXdomainXX.com
ldap._tcp.dc._msdcs..XXXXX.ad.XXXX.com SRV service location:
priority = 0
weight = 100
port = 389
svr hostname = XXservernameXX.XXX.ad.XXdomainXX.com
ldap._tcp.dc._msdcs..XXXXX.ad.XXXX.com SRV service location:
priority = 0
weight = 100
port = 389
svr hostname = XXservernameXX.XXX.ad.XXdomainXX.com

references:

  • StackOverflow post

Deployment Recommendations

Today is a day of reflection, thinking of everything that happened the past couple of months lots of overtime due to a third party that carelessly released something that broke a lot of things, a mayor deployment was made, and 100’s of errors suddenly appeared.

That makes me think what happened to testing? What about standard practices on mayor deployments?

I had to spend a lot of time further enhancing our product prevent or fool proof it so that if they do something similar it won’t affect us, again…

Week after week of telling them about the errors, and explaining what we needed all went back to normal.

All starts with development, the first step for a successful deployment is testing, testing, testing.

You need to make sure the code you are delivering is rock solid, no uncaught exceptions, correct validations, etc. also you need to make sure it can be deployed.

And before I forget did I mention you have to test?

One comment heard was “but there are a million rules in the system”, well if you are going to do a mayor version upgrade that will affect all your customer that have millions of rules, well, you have a million tests to write.

Now, hold on a second a million tests?

By the time we will be live the application will already be obsolete …

All starts with prevention, Don’t you have your unit testing in place to automate the testing? (really?)

So let’s go to the second recommendation.

Let’s assume (as it happens very often) you don’t have your testing framework in place, let’s do the deployment, with one condition no down time or minimize the downtime.

What?, can’t do that? Don’t know how?

When a release is to be made, and there are too many rules or validations that you don’t have time to verify, a rollback strategy is required.(a rollback procedure is ALWAYS required)

The deployment process is simple: backup/deploy/test, all work?

Then good, It Doesn’t work? take 20 minutes to figure out why, still failing? rollback.

If the deployment is of a larger scale your planning has to be done with more care

Best approach? do a side by side deployment and start to roll out your customers one by one or in controlled groups so if one has an error we place him back to where he was (he was happy right? I know when things work I’m happy) then continue working on his issues until fixed then rinse and repeat for the next customer.

Its an slower approach but is the best one (little downtime, no headaches)

Another approach is to go cold turkey and place everyone at the same time to production, but this is risky and you risk your reputation and your customer’s Rep. which is by far the worst thing you can do, most likely after that they will want to get rid of you (and they will eventually)

(*rant start*) that is what happened to us,  we “the customer ” had to do the provider QA /QC (grrrr) we had no option for rollback “no we can’t do that” .. well that sucks big time and you know it homenet .. (* rant end*)

To sum up to do a deployment :

  1. Test
  2. integrate your code and test again
  3. backup
  4. deploy and test, if errors grant some minutes(not days) to fix
  5. if can’t fix, rollback
  6. if can’t rollback quit and go work on MacDonald’s (a poorly cooked hamburger can go to the trash and only 1 customer will be affected)

If for any reason you cannot do a partial upgrade or a roll forward approach something is not right on your design.

Always separate the layers on your application.

image

I will expand more on this next time. (UX stands for User Experience)

How to find a job in technology

This blog post is intended for those who have a computer science degree or similar, but it may also apply to everyone else, to some extent.

When you come out from school you start wondering who is going to hire you, when I started my job hunt, I wasn’t even out of the school (I took my bachelor’s degree in Mexico), competition is hard, finding a job is hard …

Sure is, if you don’t know what to do to improve yourself.

image

One of the most common complains when you are a freshmen is the vicious cycle of  “experience = job = experience”, if you don’t have experience you don’t get a job, but you can’t get a job, since you don’t have any experience…

How many times we have heard that?, when internet was being adopted, it was harder to find resources, tutorials, or information about something you wanted to start. It was never hard, c’mon! you have to know how to search.

In today’s job world, is really important to show off what you can do, do you have enough time in your hands to look for a job? are you 8 hours a day outside knocking on doors? of course not; Why don’t you spend your time enhancing your resume doing actual work?

As with anything that is worth in life you have to start investing something (this is for your growth) so start thinking of spending some dollars a year for a hosting place, do some work, publish it, get involved in open source projects, create a blog, find user groups, assist and learn.

The era of the no experience no job, is easier to overcome this days.

You just have to leave your couch and start coding.

Samples?

Create an online resume builder, create an android application to create lists of tasks, create a grocery shopping list .. even a calculator will help .. do as many as you can, you can get the experience from there, expose the work you have done, publish it for free, the more they talk about it the better, accept all critics, there is a saying “Don’t criticize your enemies, they may learn something”  (don’t know who said it)

And one more suggestion, use several technologies in your project, make them interact with each other.

The grocery list, create a web application on asp.net, create an android client for the phone, manage the web services with Azure or Amazon Cloud services, synchronize the information with a windows 8 app, etc. (I omit the IPhone, IPad and junk, since its not as easy to start on it as it is with windows/java/android)

Also, you have to manage your online reputation, some of the things you may need:

  • Blog
  • Twitter account
  • Google+ identity
  • Linked in
  • About me
  • Leverage any other social sites (empireavenue.com, klout.com, etc.)

I don’t include Facebook, unless you think is worth it, as for me, I keep it as private as possible, all else is open.

As with everything, you have to start somewhere, and even if you are bad, as you continue working on it you will improve.

Tutorials? information?

bing.com, google.com, yahoo.com, are good places to start (SEARCH!)

There are so many free tools to use and also you can learn so much for free, for example you can start with:

And many more…

Is amazing the kind of things you can do, when you spend your time where you are supposed to.

Feel free to me your questions, I may be able to help out

Windows 8 First Look

Finally my windows 8 virtualization on VMware worked, if you search in their support forums, they tell you windows 8 is not supported, after adding and removing hardware it turns out the Floppy Drive is the one that was causing the issues. You can find more of that in this

So, Once you virtualize your environment what is next?

(Note: all links on pictures are for a bigger image)

As mentioned in this , we cannot turn off the customer experience program, but there are some others you may want to change.

image

Same for the error reporting, of course we want to report any issues to Microsoft, we want this OS to rock! image

In the configuration settings there are several ways to implement your account, you can use your Windows Live Account Microsoft Account, or local accounts (I haven’t tested domain accounts just yet).

Once you log in, you are welcomed by the Start Menu Live Tiles.

image

And here is where I start pouring some questions.

Since the release of the Developer Preview my concern was on how this start menu works, you are supposed to have live tiles, similar to what you see on your windows phone, so, I have some questions:

  • What happens then when you are not looking at that screen?
  • If you have multiple monitors, will the tiles window remain open? (so far in all my tests the answer is no, unless you snap the window to the left or right but still what about those non metro apps?)
  • What if you have three monitors or more?

I mean those details as I see them one will just have to get use to it, since the Tiles is the “new” start menu, but instead of popping like windows 7

image

It will go full screen.

Now lets get into IE 10.

When you open Internet explorer 10, you know you are in it since there is nothing else on the screen (which is nice), my first page to visit was www.bing.com which I was pleased to see a cool HTML 5 animation, I really liked the background for Windows 8 Beta, with light effects and all.

image

Minimalistic view of Internet explorer:

image

No plugins are allowed (so flash/silverlight is dead uh?)

In this site there is a flash video: image

And this is a page with Silverlight: image

The main objective of IE10 is just to display your pages, therefore is minimalistic 100%, which is good and bad, where are my options? how can I configure the settings? security? cookies?

Well, I have to figure that out if you open the desktop and click on IE, you will get access to the “old” IE9 interface, the thing is, you are using IE10

image

So, will this mean, you can set the settings for the other view? Well, after we play around with it we will find out.

Another thing to notice is the Ribbon bar on the explorer, it starts minified, on the developers preview it was expanded by default, clunky and in the way, here, you can go enabling what you need as you need it.

When you click the option it expands:

image

And that is nice.

Windows Shortcuts still work:

  • Windows key (WK) +1 ..
  • WK + D
  • WK + W
  • WK + L
  • etc…

The apps, seem to be better organized than what we had on the Developer Preview

image

And so far, I’m liking it. So many things to talk about on this O.S. but I will not focus on infrastructure, “Spock, I’m a developer not an engineer”

Still tempted to upgrade my laptop.

Well, next step, Install Visual Studio 11.

See you then.

Windows 8 inside VMware Workstation 8

If you have some experience with virtualization you will see that this is the best option to create different testing environments, try new software or just use different applications in the same computer (like mixing windows and linux).

Installation on VMware is simple enough, the problem are those little “gotcha” that can ruin your mood.

So lets start, you have to get your copy of Windows 8 (don’t forget to get the key  (DNJXJ-7XBW8-2378T-X22TX-BKG7J)

In order to create the virtual machine you select the File –> New Virtual Machine.image

You have to select to install the operating system later, if you don’t do that VMware will try to create the unattended install file (which works for Windows 7).

You can select any operating system, but in this scenario we select Windows 7 x64 to simplify the selection of drivers and devices.

image

You name your Virtual machine, and specify the location (I’m skipping that picture)

After that you specify the hard drive settings, I usually select a single drive, since its better performing.

Once you get to the Hardware screen:

image

Click on the Customize Hardware, here is the main caveat, you have to remove the floppy disk from the available selection

image

That will prevent Windows from Crashing, at least that did it for me, I also (as an extra precaution I disabled the 3d Graphics on the display configuration.

image

Once that is done, save your virtual machine, and change the ISO on the DVD to the newly downloaded copy of windows 8, after that it will boot, you have to do somewhere around 4 clicks and the installation will be completed.

There is not a lot to configure or change, once the installation goes, select the hard drive, and let it rip, you will be up and running in no time.

I have a couple more post you can check on some other details about the installation and configuration, and later on the week I will be adding more info on how it works.

I will be enabling the 3d acceleration on VMware, we’ll see if we crash or if it works as expected

Next step is to install Visual Studio 11 and start throwing lines! 😀

Get set, ready, Code!!

Installing windows 8, What to expect

image BEtA!

When installing windows 8 you can expect a smooth installation, really easy to follow, the problem goes if you run it on VMware, it just doesn’t work.  Here is the update with the way to set it up right.

In any case, I will be trying to make it work, for a fact, in Virtual Box it works like a charm.

This initial post is about the little things we always overlook, and that is the agreement.

This is a “free” copy, and as once Windows 7 was, this also has an expiration date, 01/15/2013 Smile you have a full year to play around.

image

In a second notice, Microsoft will be reading most of the things you will be doing, some you can opt out, some others you just can’t, but the idea is to give feedback, so enable them or leave them enabled.image

As the year goes around you will be able to access applications that will be posted for free in the market place, therefore, is “free for all” kind of approach, see the tools, use them, and share feedback (most importantly)

imageimage

But in the end, when the trial is over, those apps, will no longer be available to you, unless you purchase them, or perhaps some of those will remain free.

Also to notice if someone has an application that is doing something its not supposed to do, and you acquired it by mistake or not, Microsoft if he sees fit, will pull the plug and you wont have access to it anymore.

All is oriented to the apps, that will be the goal for this operating system, is a good idea, you buy lots of apps for your phone, why not for your pc?

The same ease of access that the market place brings to your phone will now be available to your pc, err.. device.

image

It seems the “Windows Live” brand will go away, I have seen a couple of posts about it, but this is the main indication that it will fade away? (time to do some research..)

Well, as I was trying to update some screen shots on the installation process on VMware, when the Devices ready was more than half way done..

image

BAM! Smile I was welcomed with the new “Blue Screen”

image

And as usual with a Blue screen, sometimes it work sometimes it doesn’t… which in this case it didn’t work.

Well, see you in the next post 🙂 once I complete my windows 8 installation.

(So tempted to upgrade instead of virtualizing it)

Windows 8 Public Beta available now

I just watched the public release of windows 8, lots of new features, and Visual Studio 11 beta is out too, (I hope the screens aren’t as bad as they seemed on the preview they gave)
Anyhow, Here are the links
To get your windows 8:

Windows 8 Beta
Windows 8 Beta

To get Visual Studio:

Visual Studio 11
Visual Studio 2012 Beta

This leap day is really exciting 🙂 now to wait other 4 years for this?

Will be updating people once I install my copy 😀

Windows Phone 7–App hub Issues

All started once I got my windows phone, I had some trouble trying to connect my account on App hub, in the end all worked out, I have my account setup and everything is set.

Now this post is more of a tale of what happened and the things I had to do to be able to use it.

The particular setup associated to my account is different to what you normally see, or so it seemed to be.

The account setup is fairly simple and easy to follow

  • You login with your windows live account
  • Create an app hub account
  • Pay 99 dollars and you are set.

image

Right?

Well it seems not, for some of us, there are issues that are different per account.

For me, the main problem was related to the credit card validation

image

Every single time I added my credit card information (no matter which one) the application will come back telling me that is not valid.

There were several links and recommendations on how to fix this issue, but they were not working. (the forum I was directed to)

One of the suggestions is go to https://billing.microsoft.com/home.aspx  and add your credit card information in there

image

Well, there were no options for doing that (I tried a couple of accounts, and had the same issue)

Later on (from a reply from the tech support team on the app hub) I had to go to http://www.microsoft.com/windowsphone/en-us/default.aspx to add my credit card information.

I’m a developer, so my train of thought was:

  1. Set everything up, so you have the account ready
  2. Download the resources and set your Dev. environment
  3. Finally pair your device with the above already setup.

What happened every time when I was trying to add my credit card information was that there was no phone attached to my account.

image

And non of the emails related to the support ticket I was following told me anything about that, I had my phone (I got it from the evangelist on my area, see this post), I had a windows live id, but, I did not associate my live id with my phone.

The issue starts from the app hub having problems with the credit card validation, but if the workaround is there, well, is not so big of an issue, right?

We Devs. tend to think like that, but as consumer it’s not a good response.

Anyhow back to were we were.

I had to create a different account, in this case a Hotmail account (against my will since I wanted to use my own domain/email address) but in this case this will have to do.

Then you would ask, why you didn’t try pairing your domain/email again with a windows live id?

For a simple reason, I was hosting my custom email with: http://home.officelive.com

But I received a note that they will pull the plug on it, and I will be forced to move to Office 365 if I want to keep what I have, but obviously costs will be higher (but this is a story for some other time)

And that seemed to have trouble with my windows phone, since it was unable to authenticate my account. (good thing it failed, #Fail on the reporting why it failed)

After all the setup and the new live account added:

image

So, in the end here are my recommendations to create an app hub successfully and painless.

  1. Make sure the live account you are using is valid
  2. Check your billing address in three different locations:
    1. https://live.xbox.com/
    2. https://billing.microsoft.com
    3. and finally: https://www.windowsphone.com/en-US/my
  3. Pair your windows phone and setup your ZUNE account on your local machine before attempting anything.
  4. Be patient when contacting app hub, the volume of requests must be really high, understandable, but not likeable

And now, once you are set, happy coding! Smile

Check this post for Windows phone Development resources
and this post for initial setup of a development environment

Last but not least here is how to unlock your phone once all the above steps are completed

Later!

My Hello World is here

We went to lamaze class for the baby, I read a lot of information about it, I also received multiple warnings or advises from friends regarding not sleeping, the crying, etc.

But, no matter how “prepared” you are, you are not. It’s really like when you are doing consulting services, you have the knowledge but until you face the actual problem is when you know if you really “know”.

It all start as a customer calls, “we have a problem is occurring every 10 minutes” in case of your wife she says “Honey, I’m starting to feel something, is occurring every 10 minutes”.

When the computer starts  performing poorly you run and check graphs and stuff just to figure out what is going on

 

Then you start running some tests, verifying, asking questions, checking the current status of everything, when the problem starts to increase, and a resolution is required, you jump in, attack head onto the problem, and then at some point in some way, you get it, all fixed.e

As always there is stress, specially if you are in a mission critical problem, and I have had some bad server crashes, with lots of stresses, but nothing, nothing compares to what happened on my Friday.

This is the story of how my baby came to this world.

The day before I had one of those nights when something is out of whack, we had a release scheduled which was completed successfully, as with any other release some items go flawlessly, some others require a minor tweak here and there, but all was fine, nonetheless, I was unable to sleep, something was amiss.

Next day I went to work normally, with a weird feeling that I had to finish everything that day.

I finished almost everything by 4pm, where I had a status meeting with my boss, so we started the conversation, and some minutes later I got the call which I ignored since I was in a meeting.

Then the second one, and the third one then I had to pickup

“This is tech support how can I help you?”  We are having a problem, some irregular behaviors are occurring every 10 minutes and it’s increasing.

“Thanks, I’m sorry to hear you are having some trouble” Yes, we need support on site.

So, as expected I had to cut the meeting short, and proceed to where I was needed.

Traffic was bad, as it is in this area in California (not as bad as in L.A., but still), so I made it and proceed with the evaluation.

  • When you started seeing the problem?
  • How often is happening?
  • Are you able to work?

And this is the part where it got rocky, as time progressed, it became more sensitive, it’s like when you are trying to figure out the server problem, you poke here, change a setting there and all is fine, but sometimes it just goes terribly wrong, change a setting.. BAM! blue screen, you try to recover and so you keep doing, at one time nothing I tried worked, and that is really frustrating, nothing seems to be ok. (My wife torn the house down in search for comfort)

And from there you rush to the hospital, or you call backup..

And you start monitoring other counters..

WP_000003

If a green bar all they way to the top meant something, ha!, a mere 60 here is more than you can imagine, every spike, every drop, every second, you wait and wait and wait…

And as when you find a setting in the server that seems to relief the problem you breathe, when some pain killers are added all goes to a relative calm.

But as with everything, you think you got it solved, BAM! and BAM!! there it goes again, and this time even harder, you can stay up all night checking all that, as I was this past Friday, but something else was also eating my energy, the stress my wife was feeling.

After a lot of effort on my wife’s end, and me struggling helping her out (I inadvertently took the place of a nurse that was there to help, NO WAY I was going anywhere)

After half an hour of more struggling, counting, coaching, the final push, and then the most beautiful thing my eyes ever saw came to life, a short but loud cry said it all, my wife was so relaxed afterwards it seemed she just woke up from a long peaceful dream.

WP_000013

My back, my feet, my head, all were aching, but it didn’t matter, since she was here, my small Julianna, my tiny “Hello World”  that is my world.