ADSI and Visual Basic

L

Leonardo A.

I'm trying to access this property on Active Directory
Server (Windows 2000 Advanced Server):

"Prompt user to change password before expiration"

which is in:

"Computer Configuration/Windows Settings/Security
Settings/Local Policies/Security Option", under Group
Policies, under a Domain Policy.

I'm using ADSI with Visual Basic. In "Domain" object, I
can only access some values of security policies,
like "Maximum Password Age", "Minimum Password Age", but
not the mentioned one (Prompt user to change password
before expiration)

Any idea will be appreciated.

Regards.

Leonardo A.
 
M

Michael Holzemer

Leonardo said:
I'm trying to access this property on Active Directory
Server (Windows 2000 Advanced Server):

"Prompt user to change password before expiration"

which is in:

"Computer Configuration/Windows Settings/Security
Settings/Local Policies/Security Option", under Group
Policies, under a Domain Policy.

I'm using ADSI with Visual Basic. In "Domain" object, I
can only access some values of security policies,
like "Maximum Password Age", "Minimum Password Age", but
not the mentioned one (Prompt user to change password
before expiration)

Any idea will be appreciated.

I would start here. Maybe you can figure out a mathematical way to determine
the expiration.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/iadsuser_setpassword.asp

--
Regards,

Michael Holzemer
No email replies please - reply in newsgroup

Learn script faster by searching here
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp
 
L

Leonardo A.

-----Original Message-----


I would start here. Maybe you can figure out a mathematical way to determine
the expiration.
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/adsi/adsi/iadsuser_setpassword.asp

Hi, thanks for your reply.
I think you're confused. I don't want to get password
expiration date (I know that property!).

What I'm looking for is "number of days Windows gives an
advice to a user before his password expires". For example:

I change today my password.
My password age is 30 days.
I have set my "Prompt user to change password before
expiration" property to 15.
So, in 15 days, when I logon, I'll get a windows
advice: "Your password will expire in 15 days, do you want
to change it now?".

What I need is to acces that "15" <----

Best Regards,

Leonardo A.
 
M

Michael Holzemer

Leonardo said:
Hi, thanks for your reply.
I think you're confused. I don't want to get password
expiration date (I know that property!).

What I'm looking for is "number of days Windows gives an
advice to a user before his password expires". For example:

I change today my password.
My password age is 30 days.
I have set my "Prompt user to change password before
expiration" property to 15.
So, in 15 days, when I logon, I'll get a windows
advice: "Your password will expire in 15 days, do you want
to change it now?".

What I need is to acces that "15" <----

Best Regards,

Leonardo A.

My point is that you can do a datediff between the expiration date and today
to obtain the value you seek.

--
Regards,

Michael Holzemer
No email replies please - reply in newsgroup

Learn script faster by searching here
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp
 
L

Leonardo A.

-----Original Message-----


My point is that you can do a datediff between the expiration date and today
to obtain the value you seek.

Mmmm... I'll explain a little better.
In a Group Policy you can configure how many days before
the expiration date Windows advice to a logging in user
that his password is going to expire. That configuration
is nothing to do with expiration date: IT'S A NUMBER. It
can be 10, or may be 15, or 3. I need to access that
configuration from my Visual Basic Application.

I know I can make a datediff between dates you mentioned.
In fact, I need to do that. BUT, additionally, I need to
compare to the other Property (Prompt user to change
password before expiration) to know if I need to tell to a
user somthing or not. In previous example, if you are in
the day #15, but property configuration is 3, Windows will
not show any "special window" until day #27. That day,
after the user logs, windows will tell him:

Your password will expire in 3 days, do you want to change
it now?

Again, what I need to access is WHAT IS CONFIGURED AT
DOMAIN POLICY LEVEL.

Best Regards.

Leonardo A.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top