Sharepoint online group based on ad groups

This topic contains 1 reply, has 2 voices, and was last updated by  Richard Diphoorn 2 months, 4 weeks ago.

  • Author
    Posts
  • #71297

    Crazyfrog81
    Participant

    Hi,

    Have an specific issue.

    Have local AD with different security groups. I want to add members to sharepoint online groups.

    Am not quite sure how to attack this issue. Assume the best way is to export all the groups to an csv and use this to add members to the groups in SP.
    Will be naming the groups on both end exactly the same.

    Need some assistance with the looping. (Struggling to wrap my head around the best way to foreach)

    What I go :

    $adminUPN="admin@customer1.onmicrosoft.com"
    $orgName="Customer1"
    $userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
    ## Download : https://www.microsoft.com/en-us/download/confirmation.aspx?id=35588 (sharepoint online powershell)
    Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential

    Get-ADGroup -SearchBase "OU=Sec_group,DC=contoso,DC=Local" -filter * | select name | Sort-Object name | export-csv C:\report\adgroups.csv
    $import = import-csv C:\report\adgroups.csv
    foreach ($user in $import) {

  • #71326

    Richard Diphoorn
    Participant

You must be logged in to reply to this topic.