Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] New-PNPGroup -Owner property does not work with Group #4692

Open
1 of 6 tasks
SPDEVGUY opened this issue Jan 19, 2025 · 1 comment
Open
1 of 6 tasks

[BUG] New-PNPGroup -Owner property does not work with Group #4692

SPDEVGUY opened this issue Jan 19, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@SPDEVGUY
Copy link

Reporting an Issue or Missing Feature

Issue

Expected behavior

When making a new group, I expect to be able to use an existing group (Site Owner Group) as an owner of the new group.

Actual behavior

Group is created, error message "Group cannot be found", and the group owner on the new group is set to my current user.

Steps to reproduce behavior

$w = get-pnpWeb
$spOwnerGroup = get-pnpproperty -ClientObject $w -Property AssociatedOwnerGroup

$spGroup = new-pnpGroup `
        -Description "testing group with owner set to site owner group ($($spOwnerGroup.Title))" `
        -Owner $spOwnerGroup `
        -Title "New group test"

Receive error:
New-PnPGroup: Group cannot be found.

Group is created on site, but the Owner is not set to the SP Owner Group, it is set to my account.

What is the version of the Cmdlet module you are running?

2.12.0 Windows.

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@SPDEVGUY SPDEVGUY added the bug Something isn't working label Jan 19, 2025
@SPDEVGUY
Copy link
Author

This will work if you provide.

-Owner $spOwnerGroup.LoginName

However, it really should be able to accept an SPGroup as a binding....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant