Solved

Need help modifying a PowerShell script

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

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article shows how a content item can be identified directly or through translation of a navigation type. It then shows how this information can be used to create a menu for further navigation.
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

20 Experts available now in Live!

Get 1:1 Help Now