Solved

Where can I download ADSI?

Posted on 2009-05-12
24
1,050 Views
Last Modified: 2013-11-05
Where can I download ADSI?
0
Comment
Question by:Abdu_Allah
  • 11
  • 11
  • +1
24 Comments
 
LVL 57

Expert Comment

by:Mike Kline
ID: 24367635
are you talking about ADSIEdit?
http://support.microsoft.com/kb/892777
That is part of the support tools.
Another good tool for viewing objects is AD Explorer
http://technet.microsoft.com/en-us/sysinternals/bb963907.aspx
 
Thanks
Mike
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24367830
I'm talking about Active Directory Services Interface.
0
 
LVL 2

Expert Comment

by:iamshaked
ID: 24368064
http://technet.microsoft.com/en-us/library/cc749949.aspx

down at the bottom where it says
To Install ADSI
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 71

Expert Comment

by:Chris Dent
ID: 24368205

Why do you think you need to download ADSI? Because most systems have it installed. If you're doing a bit of scripting on a Windows machine you certainly don't need to download it.

Chris
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24368226
The download link does not work , it takes me to http://www.microsoft.com/windows/
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24368239
>If you're doing a bit of scripting on a Windows machine you certainly don't need to download it.

I'm doing a scripting on Vista where ADSI is not installed.
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24368531

Yes it is. I use Vista here and can quite happily test code using ADSI.

Would you be able to share your code with us? Perhaps that might indicate why.

Chris
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24368827
What Vista you are using? I'm using Vista Home Premium.
The following is my code:

            Dim dso = GetObject("WinNT:")
            Dim lobjUser = dso.OpenDSObject("WinNT://" & domain, domainAndUsername, pwd, 1)
 
            'WScript.Echo(Err.Number)
 
            If Err.Number = 0 Then
                'WScript.Echo("Authenticated")
                If lobjUser.Homedirectory = "" Then
                    intErr = 2
                    'txtErr = "User does not have home directory, please contact your administrator."
                Else
                    _HomeDirectory = lobjUser.Homedirectory
                End If
            Else
                'Not authenticated
                intErr = 1
                Return False
                ' WScript.Echo("Not Authenticated")
            End If

Open in new window

0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24368889

Ultimate. You know you can't combine Dim and value assignment in a single statement in VbScript? You'll need a Set or two as well.

It would have to be something like the below, where : is just the equivalent of a line break.

What error are you getting returned if that's just a copy / paste based typo?

Chris
            Dim dso : Set dso = GetObject("WinNT:")
            Dim lobjUser : Set lobjUser = dso.OpenDSObject("WinNT://" & domain, domainAndUsername, pwd, 1)
 
            'WScript.Echo(Err.Number)
 
            If Err.Number = 0 Then
                'WScript.Echo("Authenticated")
                If lobjUser.Homedirectory = "" Then
                    intErr = 2
                    'txtErr = "User does not have home directory, please contact your administrator."
                Else
                    _HomeDirectory = lobjUser.Homedirectory
                End If
            Else
                'Not authenticated
                intErr = 1
                Return False
                ' WScript.Echo("Not Authenticated")
            End If

Open in new window

0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24368933
I'm getting error number -2147221005 , per this website http://www.stylusstudio.com/xsllist/200008/post31110.html
It means Invalid class string.
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24368951

On what line? What's the Err.Description value?

Or just kill off any "On Error Resume Next" statements and let it drop the error to the console :)

Chris
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24368952
By the way this script is in .NET page so there is no place for "Set" command.
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24368993

"_HomeDirectory"

_ is generally reserved, it allows a command to continue over a line. It cannot be used at the beginning of a variable name. That throws an error as well.

Chris
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24369173

I'm so confused now. You said "I'm doing a scripting".

VB .NET certainly can't be run as a client-side script, largely because it isn't a scripting language.

> this script is in .NET page

So is it a client-side script? Or something the server hosting the site is processing?

It's not JavaScript, so VbScript... Makes sense with all those WScript.Echo statements around the place.

Chris
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24372303
it's server side script, so what's the problem with it?!
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24372406

Okay, if I assume it's VB .NET (and not a script at all)...

What values are you passing for "domain"? And which line is producing the error message?

If the variable name is accurate it cannot have a homeDirectory property which would potentially cause an error.

Inclusion of WScript.Echo still confuses me, but there we go.

Chris
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24375284
>On what line? What's the Err.Description value?

Err.Description  is "Unspecified error "
on line # 1
 
Forget WScript as you can see it's comented out, this is result from copy/paste operation.
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24375299

Is line 1 this in yours?

Dim dso = GetObject("WinNT:")

Chris
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24375390
sorry the problem is on line # 2
Dim lobjUser = dso.OpenDSObject("WinNT://" & domain, domainAndUsername, pwd, 1)
 
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24375487

Hard-code values to check it works in principal.

e.g.

Dim lobjUser = dso.OpenDSObject("WinNT://yourdomain", "yourdomain\username", "password", 1)

You will get "Unspecified error" if the value for "yourdomain" is not correct.

Chris
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24403190
Ok I get rid from that error but why I got this error:
"Public member 'Homedirectory' on type '_ComObject' not found."
on line number 8 of your code!
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 24403478

What are you passing for "domain"? That value can only exist on a user account.

Chris
0
 
LVL 3

Author Comment

by:Abdu_Allah
ID: 24412063
>What are you passing for "domain"? That value can only exist on a user account
Not sure if I got your point but I the authentication was successfully done but the problem appear on line 8 of your code.
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 24412219

Sure, but you'll only be able to get that value if this is passed for "domain":

domain = "yourdomain/username"
Dim lobjUser = dso.OpenDSObject("WinNT://" & domain, domainAndUsername, pwd, 1)

If domain is just:

domain = "yourdomain"

Then it won't be able to return the HomeDirectory property, it doesn't exist on the domain object, only on the user account object.

The authentication stands separately from this, all that does is give you a connection to "domain" using the credentials supplied. It doesn't implicitly allow you to access anything belonging to domainAndUsername.

Chris
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 2008 set profile 9 45
EXCHANGE, ACTIVE DIRECTORY 4 45
Windows 2012 R2 DNS ListenAddresses Null Value 4 31
DNS forwarders "unable to resolve" 1 56
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question