Skip to content

Commit f88181c

Browse files
authored
Merge pull request #3035 from KoenZomers/AdjustAddSiteCollectionAdmin
Made `-Owners` optional on `Add-PnPSiteCollectionAdmin`
2 parents 9e8d444 + eaa9c83 commit f88181c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2020
- Fixed issue with `Grant-PnPAzureADAppSitePermission` cmdlet where users are not able to set selected site in the `Sites.Selected` permission. [#2983](https://github.com/pnp/powershell/pull/2983)
2121
- Fixed issue with `Get-PnPList` cmdlet not working with site-relative URL as identity. [#3005](https://github.com/pnp/powershell/pull/3005)
2222
- Fixed issue with `Add-PnPNavigationNode` cmdlet where the target audience would not correctly be set when creating a node as a child of a parent node [#2940](https://github.com/pnp/powershell/pull/2940)
23+
- Fixed issue where `Add-PnPSiteCollectionAdmin -PrimarySiteCollectionAdmin <user>` would require owners to be specified as well
2324

2425
### Contributors
2526

documentation/Add-PnPSiteCollectionAdmin.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This will add all users with their title ending with "Doe" as additional seconda
4646

4747
### EXAMPLE 4
4848
```powershell
49-
Add-PnPSiteCollectionAdmin -PrimarySiteCollectionAdminrs "user@contoso.onmicrosoft.com"
49+
Add-PnPSiteCollectionAdmin -PrimarySiteCollectionAdmin "user@contoso.onmicrosoft.com"
5050
```
5151

5252
This will set user@contoso.onmicrosoft.com as the primary site collection administrator of the site collection in the current context
@@ -74,7 +74,7 @@ Specifies owner(s) to add as site collection administrators. They will be added
7474
Type: System.Collections.Generic.List`1[PnP.PowerShell.Commands.Base.PipeBinds.UserPipeBind]
7575
Parameter Sets: (All)
7676

77-
Required: True
77+
Required: False
7878
Position: Named
7979
Default value: None
8080
Accept pipeline input: True (ByValue)

src/Commands/Site/AddSiteCollectionAdmin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace PnP.PowerShell.Commands.Site
99
[OutputType(typeof(void))]
1010
public class AddSiteCollectionAdmin : PnPSharePointCmdlet
1111
{
12-
[Parameter(Mandatory = true, ValueFromPipeline = true)]
12+
[Parameter(Mandatory = false, ValueFromPipeline = true)]
1313
public List<UserPipeBind> Owners;
1414

1515
[Parameter(Mandatory = false)]

0 commit comments

Comments
 (0)