TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
SharePoint: Powershell List all the Users under Particular Site Collection
Karthik Muthu Karuppan
Apr 29
2015
Code
1.5
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
if
( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $
null
) {
Add-PSSnapin Microsoft.SharePoint.Powershell
}
$SiteCollURL = read-host
"Enter the site colelction URL "
$siteColl = get-spsite $SiteCollURL
foreach($web
in
$sitecoll.allwebs)
{
write-host
"Users under the web "
$web.url -fore cyan
foreach($user
in
$web.siteusers)
{
write-host
"User: "
$User.loginname -fore green
}
}
write-host
""
write-host
"SCRIPT COMPLETED"
-fore green
SharePoint
PowerShell List Users