Posts

Showing posts from 2012

Wix Create Directory/Directories/Folders - Doesn't work

There are times you feel you should be able to ask a question and get the complete and accurate answer, this is the case. I was searching for setting up "wix folder permissions", the first search result was my "complete and accurate answer".

Article Here - a thank you for Chris Jackson for such a post.

After finding what I was looking for; glanced the wix code and started putting the code into my existing wix project. I have put all the directory tags mentioned in the post, but the directories aren't created.

<Directory Id="TARGETDIR" Name="SourceDir">     
........
........
<Component Id="abc" .. ...>     
........
........
 </Component>     
........
........
</Directory>     
I didn't reliaze that a call has to be made for the component using the componentref in the feature like below.

<Feature Id="xyz" ....>
<ComponentRef Id="abc" />
</Feature>

After calling t…

Replacing lcd screen on a hp dv6 laptop

Image
I have replaced several lcd screens on the laptops in the past replacing screen on a hp dv6 laptop however was not that straight forward.I had to dismantle the entire laptop to get to the broken lcd.Here is how you get to the lcd.

Screen : Samsung ltn156at05 5kak55804n H02






















HP Pavilion dv6-3127dx
Intel® CoreTM i3-350M processor; 4GB DDR3 memory
500GB Serial ATA hard drive; Multiformat DVD±RW/CD-RW drive with double-layer support
15.6" LED high-definition display; Intel® HD graphics
Built-in TrueVision webcam with digital microphone; 5-in-1 digital media reader
Built-in high-speed wireless LAN (802.11b/g/n); Windows 7 Premium Edition operating system

DirectorySearcher PropertiesToLoad Add is not working

If you have played with or is using System.DirectoryServices.ActiveDirectory, you might jump into the consclusio that "DirectorySearcher PropertiesToLoad.Add " is not working/useless/will be ignored.But that might not be the case.

Lets see a sample, this sample below tries to get the list of users with their user name, first name,last name and email.

  Private Sub LoadUsersForDomain(SelectedDomain As Domain)
        If SelectedDomain IsNot Nothing Then
            Dim sentry As DirectoryEntry = SelectedDomain.GetDirectoryEntry
            Dim Searcher As New DirectorySearcher(sentry)
            Dim srs As SearchResultCollection
            Searcher.PropertiesToLoad.Add("samaccountname")
            Searcher.PropertiesToLoad.Add("GivenName")
            Searcher.PropertiesToLoad.Add("sn")
            Searcher.PropertiesToLoad.Add("Mail")
            Searcher.Filter = "(&(objectClass=user)(objectCategory=person))"
        …

Results from Active Directory search query doesn't contain all the objects

If you are wondering why AD search didnot return all the results, the answer is there is a limit of 1000 records per search.This is the scenario we had:

We have many sub domains on the network like
a1.test.com
a2.test.com

We have users under a1.test.com like a1\user1a,a1\user2a . . . .
We have also users under a2.test.com like a2\user1,a2\user2...; also we have rda2\user3 rda2\user4....;
I dont have lot of knowledge about "AD" structure or the terminology.I dont know how the rda2\user3,user4 ended up under a2.test.com

My user is rda2\user3 and if look at the user domain using the "set" command I get a2.test.com, my user dns domain is rda2.

The problem is in my windows app I am trying to show the list of users under every domain
It shows somethings like this in the treeview
a1.test.com
a1\user1a
a1\user2a
a2.test.com
a2\user1
a2\user2
But users rda2\user3 and rda2\user4 is missing from the list.

I use the following code to get the list of users.Also I use the windows …

Fetching logins from various sources - Active Directory, WIndows local logins and SQL Logins

Image
At times there is need to get the list of logins from active directory, windows local logins or sql logins.Microsoft has done very good job of providing namespaces to fetch login info from various sources.Small example attached shows you how to use the namespace and gives some insight about the namespace, hope this helps someone out there.

Active Directory Users:


Windows Logins:

SQL logins:

Private Sub GetUser(ByVal sr As SearchResult, ByVal d As Domain, ByVal domainName As String, ByRef groupMembers As SortedList(Of String, CustomLoginNode))

If sr.Properties(LDAP_PROPERTY_USER_NAME) Is Nothing Then Return

Dim adn As New CustomLoginNode
Dim Searcher As DirectorySearcher
Dim Result As SearchResult
Dim UserEntry As DirectoryEntry

If sr.Properties(LDAP_PROPERTY_USER_NAME) IsNot Nothing Then
''this doamin name is PME , d.name = pme.local
adn.DomainName = domainName
adn.UserName = sr.Properties(LDAP_PROPERTY_USER_NAME)(0).ToString()
adn.UserNameWithDomainName = adn.DomainName + &qu…

Crystal Report Build Errors in Visual Studio

If a machine has two versions of Crystal reports installed, visual studio somehow sometimes picks the older version and you endup with the following errors.

error BC30456: 'ReuseParameterValuesOnRefresh' is not a member of 'CrystalDecisions.Windows.Forms.CrystalReportViewer'.

error BC30456: 'ShowParameterPanelButton' is not a member of 'CrystalDecisions.Windows.Forms.CrystalReportViewer'.

error BC30455: Argument not specified for parameter 'endPageN' of 'Public Overridable Sub PrintToPrinter(nCopies As Integer, collated As Boolean, startPageN As Integer, endPageN As Integer)'.

error BC30311: Value of type 'System.Drawing.Printing.PrinterSettings' cannot be converted to 'Integer'.

error BC30311: Value of type 'System.Drawing.Printing.PageSettings' cannot be converted to 'Boolean'.

error BC30455: Argument not specified for parameter 'endPageN' of 'Public Overridable Sub PrintToPrinter(nCopies As…