Solved

Need help modifying a PowerShell script

Posted on 2014-04-11
2
308 Views
Last Modified: 2014-05-01
I am using this PowerShell script to get all unique SharePoint 2010 farm users:
Get-SPSite -Limit ALL | 
Get-SPWeb -Limit ALL | 
%{Get-SPUser -Web $_.Url -Limit ALL} | 
Where-Object {$_.IsDomainGroup -ne $true} | 
select -Unique loginname | 
Measure-Object | 
select Count

Open in new window

Source: http://gallery.technet.microsoft.com/office/Get-all-unique-SharePoint-4b3d69e7

As far as I understand it I get back all the unique users since the beginning of the farm. Can this be limited to only active users or even better to active users within last 30 days?
0
Comment
Question by:MisUszatek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 71

Assisted Solution

by:Chris Dent
Chris Dent earned 200 total points
ID: 39995879
Since I'm not remotely familiar with the SP CmdLets this is something of a guess.

Run this:
Get-SPSite -Limit ALL | 
  Get-SPWeb -Limit ALL | 
  ForEach-Object { Get-SPUser -Web $_.Url -Limit ALL } | 
  Where-Object { -not $_.IsDomainGroup } |
  Format-List *

Open in new window

And see if you can spot a field there which shows the activity value you're looking for. If you can, it can be inserted into the Where-Object statement and potentially used to do exactly what you want.

Chris
0
 
LVL 12

Accepted Solution

by:
Carlo-Giuliani earned 200 total points
ID: 39996242
I don't believe you can get information on which users were active in SharePoint directly.  You could combine this list with information from Active Directory to limit it to users who have authenticated in the past 30 days, but that is probably not what you want.  If you really want to know who has used which SP sites in the past 30 days you will have to parse the IIS logs to find it.  Assuming you are keeping 30 days of IIS logs.
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

688 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