{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/1100","labels_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1100/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1100/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1100/events","html_url":"https://github.com/OfficeDev/PnP/issues/1100","id":98829722,"number":1100,"title":"Cmdlets: Set-SPOGroup specifying the -Web parameter","user":{"login":"mahajangaurav","id":10227531,"avatar_url":"https://avatars.githubusercontent.com/u/10227531?v=3","gravatar_id":"","url":"https://api.github.com/users/mahajangaurav","html_url":"https://github.com/mahajangaurav","followers_url":"https://api.github.com/users/mahajangaurav/followers","following_url":"https://api.github.com/users/mahajangaurav/following{/other_user}","gists_url":"https://api.github.com/users/mahajangaurav/gists{/gist_id}","starred_url":"https://api.github.com/users/mahajangaurav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahajangaurav/subscriptions","organizations_url":"https://api.github.com/users/mahajangaurav/orgs","repos_url":"https://api.github.com/users/mahajangaurav/repos","events_url":"https://api.github.com/users/mahajangaurav/events{/privacy}","received_events_url":"https://api.github.com/users/mahajangaurav/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-03T20:11:52Z","updated_at":"2015-08-03T20:48:46Z","closed_at":null,"body":"While the -Web parameter works fine for New-SPOGroup, so you can specify the web where the group should be created, it does not work for the Set-SPOGroup command and gives an invalid context error"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP/issues/comments/127402635","html_url":"https://github.com/OfficeDev/PnP/issues/1100#issuecomment-127402635","issue_url":"https://api.github.com/repos/OfficeDev/PnP/issues/1100","id":127402635,"user":{"login":"erwinvanhunen","id":7666381,"avatar_url":"https://avatars.githubusercontent.com/u/7666381?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinvanhunen","html_url":"https://github.com/erwinvanhunen","followers_url":"https://api.github.com/users/erwinvanhunen/followers","following_url":"https://api.github.com/users/erwinvanhunen/following{/other_user}","gists_url":"https://api.github.com/users/erwinvanhunen/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinvanhunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinvanhunen/subscriptions","organizations_url":"https://api.github.com/users/erwinvanhunen/orgs","repos_url":"https://api.github.com/users/erwinvanhunen/repos","events_url":"https://api.github.com/users/erwinvanhunen/events{/privacy}","received_events_url":"https://api.github.com/users/erwinvanhunen/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T20:48:46Z","updated_at":"2015-08-03T20:48:46Z","body":"I can confirm this to be an issue. Until I fixed it I can offer this workaround\r\n\r\n```powershell\r\nConnect-SPOnline -Url $RootSiteUrl -CurrentCredentials\r\n$SomeWeb = New-SPOWeb -Url \"Some\" -Title \"Some Site\" -Template \"STS#0\" -BreakInheritance:$true -InheritNavigation:$true -Description \"This website is used to generate and manage some stuff\"\r\n$VisitorsGroup = New-SPOGroup -Title \"Some Site Visitors\" -Web $SomeWeb -AllowRequestToJoinLeave:$true\r\nConnect-SPOnline -Url $RootSiteUrl/Some -CurrentCredentials\r\nSet-SPOGroup -Identity $VisitorsGroup.Title -SetAssociatedGroup Visitors\r\n```\r\n\r\nThe reason this works is because of the added connect-sponline statement and the modified Set-SPOGroup cmdlet. During the context switching behind the scenes there are some mismatches between the context of the group returned and the context used in the Set-SPOGroup statement."}}