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
Solved

Need help modifying a PowerShell script

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Synchronize a new Active Directory domain with an existing Office 365 tenant
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

840 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