• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

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
0
mshakeb
Asked:
mshakeb
  • 5
  • 3
1 Solution
 
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
 
mshakebAuthor 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mshakebAuthor 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
 
mshakebAuthor 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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now