Solved

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

Posted on 2014-11-25
8
150 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
 
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
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 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

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Terminal Server Temp Profile issue ? 12 52
Account lockouts 22 68
Unable to log into domain computer 4 39
AD Account Lockout 22 31
Introduction You may have a need to setup a group of users to allow local administrative access on workstations.  In a domain environment this can easily be achieved with Restricted Groups and Group Policies. This article will demonstrate how to…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now