Question Locked

Using Batch Script to Poll Information from Active Directory

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello Everyone,

I was wondering if there was a way to write a batch script that would be able to poll information on whether or not a user had logged into the network for a specified time. More specifically, I would actually like to be able to poll whether or not a user has logged into the exchange's webmail for a specified time.

We are running Windows Server 2003 for both our DC and EX server. We are running Exchange 2007.

6 replies

by computech911

I'm not looking for a modification on the logon.bat script for network logon. What I am looking for is a way to check the last logged in property of a user object within AD. My use will be checking to see if a user has logged in to webmail (through exchange, authenticated through AD) in a specified time.

Basically what will point me in the right direction is if someone can come up with the powershell or batch syntax that allows me to retrieve this user object property.

by computech911

I am currently looking through the large assortment of cmds in the exchange 2007 powershell that might be able to work for my situation.

If I can retrieve the 'mailbox last accessed date' property that would also work for me.

by computech911

After looking through my available mailbox properties with "get-mailbox -Ahr username | format-list -property *" I've noticed there is no 'last accessed' property. There is a 'last modified' and 'date created' but no last accessed.

So it is looking like I can't get this information from the mailbox properties. But can I get it from the user object properties from within AD? I don't know the powershell syntax to get that information. The link you provided does have some powershell information but I can't find anything related to what I need.

At this point I'm willing to settle with a way to get the date stamp of last authentication by a specific user.

This discussion is closed to new replies.