Answered by:
How to use powershell in sharepoint 2007

Question
-
How to use powershell in sharepoint 2007
- Moved by star.warsModerator Tuesday, February 17, 2015 6:10 AM sp2007
- Edited by trulyChaitu Monday, February 23, 2015 10:29 AM
Monday, February 16, 2015 12:45 PM
Answers
-
Hi
You can use get-spuser for the same.
Listing All the SharePoint Groups to Which a User Belongs
To list all the SharePoint groups to which a user belongs, you first need to find that user's SPUser object:
$user = Get-SPUser -Web http://server/sites/yoursite |
Where {$_.LoginName -LIKE "*|DOMAIN\SAMC"}Once you have this object, you can scan all the site collections in the farm and find all the groups to which the user belongs:
Get-SPSite -Limit All |
Select -ExpandProperty RootWeb |
Select -ExpandProperty SiteUsers |
Where { $user.UserLogin -EQ $_.LoginName } |
Select -ExpandProperty Groups |
Select Name, {$_.ParentWeb.Url}below link refer the same.
Regards, Rajendra Singh If a post answers your question, please click Mark As Answer on that ost and Vote as Helpful http://sharepointundefind.wordpress.com/
- Edited by RajendraPratap Singh Monday, February 16, 2015 1:24 PM
- Proposed as answer by Hemendra AgrawalModerator Tuesday, February 17, 2015 5:40 AM
- Marked as answer by Hemendra AgrawalModerator Wednesday, March 18, 2015 5:07 AM
Monday, February 16, 2015 1:17 PM -
Hello,
Here is similar thread. Try this
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help
- Marked as answer by Hemendra AgrawalModerator Wednesday, March 18, 2015 5:07 AM
Tuesday, February 17, 2015 5:40 AMModerator
All replies
-
SPWeb site = SPContext.Current.Web; SPGroup managerGroup = site.Groups["Group Name"]; bool isManager = site.IsCurrentUserMemberOfGroup(managerGroup);
******Please mark as ANSWERED if this helps************
Thanks Rahul Prabhune
Monday, February 16, 2015 1:00 PM -
Hi
You can use get-spuser for the same.
Listing All the SharePoint Groups to Which a User Belongs
To list all the SharePoint groups to which a user belongs, you first need to find that user's SPUser object:
$user = Get-SPUser -Web http://server/sites/yoursite |
Where {$_.LoginName -LIKE "*|DOMAIN\SAMC"}Once you have this object, you can scan all the site collections in the farm and find all the groups to which the user belongs:
Get-SPSite -Limit All |
Select -ExpandProperty RootWeb |
Select -ExpandProperty SiteUsers |
Where { $user.UserLogin -EQ $_.LoginName } |
Select -ExpandProperty Groups |
Select Name, {$_.ParentWeb.Url}below link refer the same.
Regards, Rajendra Singh If a post answers your question, please click Mark As Answer on that ost and Vote as Helpful http://sharepointundefind.wordpress.com/
- Edited by RajendraPratap Singh Monday, February 16, 2015 1:24 PM
- Proposed as answer by Hemendra AgrawalModerator Tuesday, February 17, 2015 5:40 AM
- Marked as answer by Hemendra AgrawalModerator Wednesday, March 18, 2015 5:07 AM
Monday, February 16, 2015 1:17 PM -
Hello,
Here is similar thread. Try this
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help
- Marked as answer by Hemendra AgrawalModerator Wednesday, March 18, 2015 5:07 AM
Tuesday, February 17, 2015 5:40 AMModerator