Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - AD entry badPwdCount property

Reply
 
Old 07-18-2007   #1 (permalink)
Nicopilami


 
 

AD entry badPwdCount property

Hi there !

when i try to get the badPwdCount property value of an ADSI entry, i
get an empty string, even if i get all the other properties;

i've tried to cast the variable as an integer, but then i always get
0;

Could you help me please ?

bye
Nico


My System SpecsSystem Spec
Old 07-18-2007   #2 (permalink)
Gerd Schneider


 
 

RE: AD entry badPwdCount property

Could you provide us with a codepiece so that we can see how you do it?
What happens if you try to get other integer-type attributes (e.g.
"logonCount")?

"Nicopilami" wrote:

> Hi there !
>
> when i try to get the badPwdCount property value of an ADSI entry, i
> get an empty string, even if i get all the other properties;
>
> i've tried to cast the variable as an integer, but then i always get
> 0;
>
> Could you help me please ?
>
> bye
> Nico
>
>

My System SpecsSystem Spec
Old 07-18-2007   #3 (permalink)
Rob Campbell


 
 

RE: AD entry badPwdCount property

Bad Password Count is only recorded on the DC where the login attempt was
made. It is not replicated. Are you sure the DC you are querying has
anything in that field?

"Nicopilami" wrote:

> Hi there !
>
> when i try to get the badPwdCount property value of an ADSI entry, i
> get an empty string, even if i get all the other properties;
>
> i've tried to cast the variable as an integer, but then i always get
> 0;
>
> Could you help me please ?
>
> bye
> Nico
>
>

My System SpecsSystem Spec
Old 07-20-2007   #4 (permalink)
Nicopilami


 
 

Re: AD entry badPwdCount property

On 18 juil, 09:48, Gerd Schneider
<GerdSchnei...@discussions.microsoft.com> wrote:
> Could you provide us with a codepiece so that we can see how you do it?
> What happens if you try to get other integer-type attributes (e.g.
> "logonCount")?
>
>
>
> "Nicopilami" wrote:
> > Hi there !

>
> > when i try to get the badPwdCount property value of an ADSI entry, i
> > get an empty string, even if i get all the other properties;

>
> > i've tried to cast the variable as an integer, but then i always get
> > 0;

>
> > Could you help me please ?

>
> > bye
> > Nico- Masquer le texte des messages précédents -

>
> - Afficher le texte des messages précédents -


> Could you provide us with a codepiece so that we can see how you do it?


sure :
$de = New-Object system.directoryservices.directoryentry
$ads = new-object system.directoryservices.directorysearcher -
argumentlist $de,$ldapQuery
$RecordList = $ads.findall()
....


Write-Host "displayname : " $Record.Properties["displayname"] " ("
$Record.Properties["cn"] ")" -foreground green
"OU : " + $Record.Properties["c"] + " (" + $Record.Properties["l"]
+")"
"profilePath : " + $Record.Properties["profilepath"]
"mail : " + $Record.Properties["mail"]
"expires : " + $Record.Properties["accountExpires"]
"badpwdcount : " + [int]$Record.Properties["badPwdCount"]
"service : " + $Record.Properties["description"]

expires ans badpwdcount are always equal to 0, and it is not nomal
because i work in a big corporation, so our users encount often
problems with locked account
In this case, the mmc console shows that the users account is locked
(gray checked field), but the badpwdcount property stays always at
zero.


> What happens if you try to get other integer-type attributes (e.g.
> "logonCount")?


logonCount seems to be ok )

bye
thx for your help
Nico

My System SpecsSystem Spec
Old 07-20-2007   #5 (permalink)
Nicopilami


 
 

Re: AD entry badPwdCount property

On 18 juil, 14:48, Rob Campbell
<RobCampb...@discussions.microsoft.com> wrote:
> Bad Password Count is only recorded on the DC where the login attempt was
> made. It is not replicated. Are you sure the DC you are querying has
> anything in that field?
>
>
>
> "Nicopilami" wrote:
> > Hi there !

>
> > when i try to get the badPwdCount property value of an ADSI entry, i
> > get an empty string, even if i get all the other properties;

>
> > i've tried to cast the variable as an integer, but then i always get
> > 0;

>
> > Could you help me please ?

>
> > bye
> > Nico- Masquer le texte des messages précédents -

>
> - Afficher le texte des messages précédents -


i don't understand what you mean, could you tell me a little bit
more ?
thx
bye
Nico

My System SpecsSystem Spec
Old 07-20-2007   #6 (permalink)
Rob Campbell


 
 

Re: AD entry badPwdCount property

If you look at the same user account, on the same domain controller that
you're running the script against with ADSIEdit, is there anything in that
field?

Badpassword counts aren't replictated (at least not among all the DCs).

I believe they are replicted to the PDC emulator. Is that the DC you're
reading the field from?

"Nicopilami" wrote:

> On 18 juil, 14:48, Rob Campbell
> <RobCampb...@discussions.microsoft.com> wrote:
> > Bad Password Count is only recorded on the DC where the login attempt was
> > made. It is not replicated. Are you sure the DC you are querying has
> > anything in that field?
> >
> >
> >
> > "Nicopilami" wrote:
> > > Hi there !

> >
> > > when i try to get the badPwdCount property value of an ADSI entry, i
> > > get an empty string, even if i get all the other properties;

> >
> > > i've tried to cast the variable as an integer, but then i always get
> > > 0;

> >
> > > Could you help me please ?

> >
> > > bye
> > > Nico- Masquer le texte des messages pricidents -

> >
> > - Afficher le texte des messages pricidents -

>
> i don't understand what you mean, could you tell me a little bit
> more ?
> thx
> bye
> Nico
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
MUI entry problem Vista General
Help! Need to know what New Entry is when rebuilding the BCD Vista General
re-entry of incorrect isp name Vista mail
Set Focus To Specific Property In Property Grid .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46