Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Logged in not working...yet

Status
Not open for further replies.

cbsarge

IS-IT--Management
Jun 20, 2001
219
US
Trying to write a script that will display the age of a users password. This is the non-working one I have so far:

Code:
Dim UserName
Dim GroupName
UserName = InputBox("Enter the display name (example: Firstname Lastname) of the USER:")
GroupName = InputBox("Enter the main group (example: Engineering) of the user:")
Set objUser = GetObject("LDAP://CN=" & UserName ,"OU=" & GroupName ,"DC=domainname,DC=com")
Wscript.Echo "Password last changed: " & objUser.PasswordLastChanged

Thanks!

[!]The AutoSavers![/!] [2thumbsup]
 
Perhaps you could explain in what way that it does not work?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
It pops an error box stating it needs a bracket at position 46 of line 5. I'm sure I have the syntax wrong on the line that tries to use the 2 variables I have set by the input boxes. I've tried a bunch of different versions of quotation marks, etc but haven't been able to get the format right.

[!]The AutoSavers![/!] [2thumbsup]
 
try:

Set objUser = GetObject("LDAP://CN=" & UserName [red] & "[/red],OU=" & GroupName [red]& "[/red],DC=domainname,DC=com")

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
LOL - Thanks EB! I thought I had tried every combination of quotation marks around different sections of the statement!

That worked great - thanks again!

[!]The AutoSavers![/!] [2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top