{"id":361,"date":"2015-11-18T14:35:30","date_gmt":"2015-11-18T14:35:30","guid":{"rendered":"https:\/\/www.sharepoint13.org\/?p=361"},"modified":"2015-11-20T10:49:12","modified_gmt":"2015-11-20T10:49:12","slug":"office365-useradmin-with-powershell-part-2-add-users-to-sitegroups","status":"publish","type":"post","link":"https:\/\/www.sharepoint13.org\/?p=361","title":{"rendered":"Office365 Useradmin with PowerShell &ndash;Part 2: Add Users to SiteGroups"},"content":{"rendered":"<p>Here\u2019s how you add users to existing SIteGroups, \u2013check <a href=\"https:\/\/www.sharepoint13.org\/?p=348\" target=\"_blank\">Part 1<\/a> for PS script on how to create these Groups.<\/p>\n<p>First create a UTF-8 .csv file with all users and groups<a href=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2015\/11\/image12.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2015\/11\/image_thumb12.png\" width=\"244\" height=\"92\" \/><\/a>     <br \/>&#8211; Groups, LoginName must exist, and off course the SiteUrl must be correct.<\/p>\n<p>Run this PowerShell script    <br \/><strong>PS&gt;Import-Csv C:\\admin\\SMusersToGroups.csv | where {Add-SPOUser -Group $_.Group -LoginName $_.LoginName -Site $_.Site}<\/strong><\/p>\n<p><a href=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2015\/11\/image13.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.sharepoint13.org\/wp-content\/uploads\/2015\/11\/image_thumb13.png\" width=\"376\" height=\"96\" \/><\/a>    <br \/>Tip: Just add more users to any group, and rerun the script, then they will be added to their group. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here\u2019s how you add users to existing SIteGroups, \u2013check Part 1 for PS script on how to create these Groups. First create a UTF-8 .csv file with all users and groups &#8211; Groups, LoginName must<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[17,11],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-office365","tag-office-365","tag-powershell"],"_links":{"self":[{"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=361"}],"version-history":[{"count":2,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":363,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=\/wp\/v2\/posts\/361\/revisions\/363"}],"wp:attachment":[{"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sharepoint13.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}