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

Get-GSOrganizationalUnit fails on sub-level orgunits when using -SearchScope Base #355

Open
sigvaldhoy opened this issue Jun 17, 2021 · 2 comments

Comments

@sigvaldhoy
Copy link

Describe the bug
Trying to use Get-GSOrganizationalUnit -SearchBase '/Gloppen kommune/Breim skule' -SearchScope Base fails with errror:

Get-GSOrganizationalUnit : Exception calling "Execute" with "0" argument(s): "Google.Apis.Requests.RequestError
Org unit not found [404]
Errors [
Message[Org unit not found] Location[ - ] Reason[notFound] Domain[global]
]
"
At line:1 char:1

  • Get-GSOrganizationalUnit -SearchBase '/Gloppen kommune/Breim skule' - ...
  •   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GSOrganizationalUnit
    
    

Searching for the same OU using Get-GSOrganizationalUnit -SearchBase 'id:03ph8a2z39nmgi7' -SearchScope Base
works like expected.

To Reproduce
Steps to reproduce the behavior:

  1. Create sub-level OU's, with white space in names
  2. Try to use Get-GSOrganizationalUnit with -SearchScope Base and path in SearchBase on sub-level OU's

Expected behavior
Same result when using OU path and OU-id in SearchBase

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows Server 2016
  • PowerShell Version: 5.1.14393.4350
  • PSGSuite Version: 2.36.4

Additional context
Suspect issue to be connected to white space in OU paths, but not confirmed

@sigvaldhoy
Copy link
Author

This is not related to white-space, I get this on all sub-levels, also when there is no white-space.
This also causes Update-GSOrganizationalUnit to fail on sub-level org-units

@macf0x
Copy link

macf0x commented Dec 9, 2021

Out of interest, how many OU's do you have in your tenant?

We have a substantial number to cover several 100 sites and functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants