Solved

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

Posted on 2014-11-25
8
163 Views
Last Modified: 2014-12-09
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
0
Comment
Question by:mshakeb
  • 5
  • 3
8 Comments
 
LVL 5

Expert Comment

by:A Karelin
ID: 40464206
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
 
LVL 1

Author Comment

by:mshakeb
ID: 40464673
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
 
LVL 5

Expert Comment

by:A Karelin
ID: 40464686
You can create a powershell script and check lastlogon attribute.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 1

Author Comment

by:mshakeb
ID: 40464713
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
 
LVL 5

Expert Comment

by:A Karelin
ID: 40464731
Yes. You can look into microsoft script repository. You can use powershell or dsquery.
0
 
LVL 5

Expert Comment

by:A Karelin
ID: 40464742
I could write this script, but i dont have AD and powershell right now and right here :)
0
 
LVL 1

Author Comment

by:mshakeb
ID: 40466159
hi experts,

Any help
0
 
LVL 5

Accepted Solution

by:
A Karelin earned 500 total points
ID: 40466175
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

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question