Can you post the code?
I tried this and it worked as expected... of course I used a ls instead of
AD object, but should be the same result.
PS C:\> $foo = ls * -recurse
PS C:\> $foo.count
77070
PS C:\> $foo.count + $foo.count
154140
PS C:\> $foo.count + $foo.count - ($foo.Count / 2)
115605
PS C:\>
"Brian Hoort" <brian.hoort@gmail.com> wrote in message
news:1168297135.721425.65500@11g2000cwr.googlegroups.com...
> How can I get foo.count to return just the integer so I can perform
> arithmetic on the result?
>
> I'm trying to write a one-liner that will return the number of
> non-disabled users in our AD. So far I can do this by invoking a
> dsquery returning all users, piping that into a ".count -line", then
> doing another with the dsquery switch that only returns disabled
> accounts, then getting a ".count -line" on that -- that far I've gotten
> (albeit with formatted output). Then I just subtract the disabled
> count from the full and get my count -- but I can't do this because the
> object .count returns isn't just an int -- it's a big formatted text
> object.
>
> Any thoughts?
>