?
Solved

Need help modifying a PowerShell script

Posted on 2014-04-11
2
Medium Priority
?
311 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 600 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 600 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

801 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