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
LVL 1
Mohammed SIIOperation ExpertsAsked:
Who is Participating?
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.
0
Mohammed SIIOperation ExpertsAuthor Commented:
Dear,

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.
0
A KarelinCommented:
You can create a powershell script and check lastlogon attribute.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

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.
0
A KarelinCommented:
Yes. You can look into microsoft script repository. You can use powershell or dsquery.
0
A KarelinCommented:
I could write this script, but i dont have AD and powershell right now and right here :)
0
Mohammed SIIOperation ExpertsAuthor Commented:
hi experts,

Any help
0
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 = "yourdomain.com"  
$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.
0

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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.