Skip to content

Instantly share code, notes, and snippets.

@ivanhub
Last active February 3, 2023 13:05
Show Gist options
  • Select an option

  • Save ivanhub/01c4336ce1b7395f96c69a74b0148128 to your computer and use it in GitHub Desktop.

Select an option

Save ivanhub/01c4336ce1b7395f96c69a74b0148128 to your computer and use it in GitHub Desktop.

Revisions

  1. ivanhub revised this gist Feb 3, 2023. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions users_and_groups.ps1
    Original file line number Diff line number Diff line change
    @@ -6,5 +6,9 @@ or

    get-SPUser -Web http://SITE|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}} | set-Content -Encoding UTF8 filename

    or

    get-SPUser -LIMIT ALL -Web http://URL |Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}}|select-string XXX|select-string "=}" -NotMatch |set-Content -Encoding UTF8 file.csv


    #$user|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}}|select-string XXX|select-string "=}" -NotMatch |set-Content -Encoding UTF8 blabla.txt
  2. ivanhub revised this gist Feb 3, 2023. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions users_and_groups.ps1
    Original file line number Diff line number Diff line change
    @@ -7,5 +7,4 @@ or
    get-SPUser -Web http://SITE|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}} | set-Content -Encoding UTF8 filename


    #$user|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}}|select-string XXX|select-string "=}" -NotMatch |set-Content
    -Encoding UTF8 blabla.txt
    #$user|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}}|select-string XXX|select-string "=}" -NotMatch |set-Content -Encoding UTF8 blabla.txt
  3. ivanhub revised this gist Feb 3, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion users_and_groups.ps1
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ get-SPUser -Web http://SITE|Select LoginName,@{Name='Groups';Expression={$_.Grou


    #$user|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}}|select-string XXX|select-string "=}" -NotMatch |set-Content
    -Encoding UTF8 blabla
    -Encoding UTF8 blabla.txt
  4. ivanhub revised this gist Feb 3, 2023. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions users_and_groups.ps1
    Original file line number Diff line number Diff line change
    @@ -5,3 +5,7 @@ $user|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}} | set-C
    or

    get-SPUser -Web http://SITE|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}} | set-Content -Encoding UTF8 filename


    #$user|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}}|select-string XXX|select-string "=}" -NotMatch |set-Content
    -Encoding UTF8 blabla
  5. ivanhub created this gist Feb 3, 2023.
    7 changes: 7 additions & 0 deletions users_and_groups.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    $web = Get-SPWeb http://SITE
    $user=$web.AllUsers
    $user|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}} | set-Content -Encoding UTF8 filename

    or

    get-SPUser -Web http://SITE|Select LoginName,@{Name='Groups';Expression={$_.Groups -join '|'}} | set-Content -Encoding UTF8 filename