Home All Groups Group Topic Archive Search About

List User Profile Properties

Author
16 Jan 2007 2:16 PM
giannetto75
Hi at all. I'm a new user about scripting....
I need to know the login script name for all my users.
Please consider that I'm in an AD named tis.local
Serching on scripting site I found the following script but, when I run it,
I don't receive any answer. Where is the error?
On Error Resume Next
_________________________________________________________-
Set objUser = GetObject _
    ("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")

Wscript.Echo "Profile Path: " & objUser.ProfilePath
Wscript.Echo "Script Path: " & objUser.ScriptPath
Wscript.Echo "Home Directory: " & objUser.HomeDirectory
Wscript.Echo "Home Drive: " & objUser.HomeDrive
__________________________________________________________
Thank in advance for your cooperation
Regrads
Gianni (Italy)

Author
16 Jan 2007 6:33 PM
Richard Mueller [MVP]
Gianni wrote:

Show quoteHide quote
> Hi at all. I'm a new user about scripting....
> I need to know the login script name for all my users.
> Please consider that I'm in an AD named tis.local
> Serching on scripting site I found the following script but, when I run
it,
> I don't receive any answer. Where is the error?
> On Error Resume Next
> _________________________________________________________-
> Set objUser = GetObject _
>     ("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")
>
> Wscript.Echo "Profile Path: " & objUser.ProfilePath
> Wscript.Echo "Script Path: " & objUser.ScriptPath
> Wscript.Echo "Home Directory: " & objUser.HomeDirectory
> Wscript.Echo "Home Drive: " & objUser.HomeDrive
> __________________________________________________________
> Thank in advance for your cooperation

The program works for me, if I substitute the Distinguished Name of a user.
You need to replace:

cn=myerken,ou=management,dc=fabrikam,dc=com

with the Distinguished Name of a user in your domain. Also, I run a script
like this by saving the code in a file with the extension *.vbs, then
running it at a command prompt with the cscript host. If the VBScript
program is saved in a file called Profile.vbs, I would run it at a command
prompt with the following command:

cscript Profile.vbs

If the Distinguished Name is wrong, or there is a typo, you should get an
error message. The error message should indicate which line of the program
raised the error.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--