Solved

Need help modifying a PowerShell script

Posted on 2014-04-11
2
306 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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This article will help you understand what HashTables are and how to use them in PowerShell.
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ā€¦

685 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