how to check the Report, that how many users are connected to DC/AD 2012

Dear Experts,

we are running Server 2012 R2 with DC and AD, our management want the report that how many users are connected to DC and AD. can any one help in this. thank you
Mohammed SIIOperation ExpertsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

A KarelinCommented:
What do you mean "how many users are connected to DC and AD"?

How many users authorize by AD? If yes you can create query that show eg how many users authorize by AD for the last month.
Mohammed SIIOperation ExpertsAuthor Commented:

Recently we moved to AD and created all users account (1000 Users) in AD 2012, we started  joining the users to domain, just we want know how many users are joined  to domain, so that we can track it. thank you.
A KarelinCommented:
You can create a powershell script and check lastlogon attribute.
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Mohammed SIIOperation ExpertsAuthor Commented:
is there any script or utility so that it will show all users all together and export in text file or CSv, as our management need the report.
A KarelinCommented:
Yes. You can look into microsoft script repository. You can use powershell or dsquery.
A KarelinCommented:
I could write this script, but i dont have AD and powershell right now and right here :)
Mohammed SIIOperation ExpertsAuthor Commented:
hi experts,

Any help
A KarelinCommented:
Something like this

# Gets time stamps for all User in the domain that have NOT logged in since after specified date 

import-module activedirectory  
$domain = ""  
$DaysInactive = 30  
$time = (Get-Date).Adddays(-($DaysInactive)) 
# Get all AD User with lastLogonTimestamp less than our time and set to enable 
Get-ADUser -SearchBase "OU=...,DC=yourdomain,DC=com" -Filter {LastLogonTimeStamp -lt $time -and enabled -eq $true} -Properties LastLogonTimeStamp | 
# Output Name and lastLogonTimestamp into CSV  
select-object Name,@{Name="Stamp"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp).ToString('yyyy-MM-dd_hh:mm:ss')}} | export-csv c:\folder\OLD_User.csv -notypeinformation

Open in new window

And check this link. There are many usefull scripts.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.