1

I need to get all the users that are added to spgroup "XX" on specific date .

$url = "https://spsite.com
$User = Get-SPUser -web $url -Group "XX"

$User | Select Userlogin,Groups,DisplayName,Email,LoginName

how to get creation date ?

2
  • You mean when the user was first added to the site? Sep 12, 2019 at 10:51
  • 1
    you will not get this for sure in above way. Adding user to the group will be logged in Audit log activity. may be you have to run a Powershell against the audit log to find which user is added to which group on which date Sep 12, 2019 at 11:52

1 Answer 1

1

well the answer is to get users from the hide spList: "siteUserinfoList"

$today=Get-Date -Format "MM/dd/yyyy"        
        $spSite = Get-SPSite $url 
        $spWeb = Get-SPWeb $url 
        $todayNewUsers =$spWeb.SiteUserInfoList.Items | ?{ (Get-date -Date $_['Created'] -UFormat "%m/%d/%Y") -eq $today}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.