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

Unable to use Update-GSOrganizationalUnit #218

Closed
Chris4678 opened this issue Jul 30, 2019 · 9 comments
Closed

Unable to use Update-GSOrganizationalUnit #218

Chris4678 opened this issue Jul 30, 2019 · 9 comments
Assignees
Labels

Comments

@Chris4678
Copy link

I have been trying to use the Update-GSOrganizationalUnit command to move an OU. Using the Wiki I have tried both the ID and path method but get an error every time.
For example:
Update-GSOrganizationalUnit -OrgUnitID "IDofOUtoBeMoved" -ParentOrgUnitPath "/NewParentOU" -ParentOrgUnitID "IDofNewParent"

This gives me an error saying parent org unit not found. I copy and pasted the path and ID from the output of Get-GSorganizationalUnit.

I then tried to get just anything at all working and tried to rename an OU:
Update-GSOrganizationalUnit -orgUnitID "IDofOU" -name "test"

This gives me a different error: "You cannot call a method on a null-valued expression" This one is pretty much an exact copy of one of the examples on the wiki so I am really not sure what to change. Any idea what I am doing wrong?

I really need to be able to move OUs, if there is another way to do this I am happy to try it out.

@scrthq scrthq self-assigned this Jul 30, 2019
@scrthq scrthq added the bug label Jul 30, 2019
@scrthq
Copy link
Member

scrthq commented Jul 30, 2019

Hey @Chris4678 - Checking this out tonight! Thanks for raising this issue, sounds like a bug to me!

@scrthq
Copy link
Member

scrthq commented Jul 30, 2019

side note - are you explicitly importing the module first or are you autoloading by running one of the command directly? if autoloading, can you try restarting your session, running Import-Module PSGSuite, then running the command and seeing if it replicates the error?

@Chris4678
Copy link
Author

I am using the import-module method. I have it as one of the first lines in my script as well as the switch config command so that I make sure I am accessing the correct account.

@scrthq
Copy link
Member

scrthq commented Jul 31, 2019

@Chris4678 - Found the issue and got it sorted! Working on a couple other issues and enhancements but I'll have this out soon!

image

scrthq added a commit that referenced this issue Jul 31, 2019
## 2.31.0

* [Issue #218](#218)
  * Fixed: Update-GSOrganizationalUnit was failing with
ull reference errors.
* [Issue #213](#213)
  * Added: Support for RELEASE_RESOURCES TransferParam for Calendar application data transfers to function Start-GSDataTransfer
* [Issue #215](#215)
  * Added:
    * Get-GSDomain
    * Remove-GSDomain
    * New-GSDomain
    * Get-GSDomainAlias
    * New-GSDomainAlias
    * Remove-GSDomainAlias
  * _These will need the additional scope of https://www.googleapis.com/auth/admin.directory.domain added in order to use!_
* Miscellaneous
  * Added:
    * Get-GSCustomer
    * Update-GSCustomer
    * Add-GSCustomerPostalAddress
  * _These will need the additional scope of https://www.googleapis.com/auth/admin.directory.customer added in order to use!_
@scrthq scrthq closed this as completed in 43e3630 Jul 31, 2019
@scrthq
Copy link
Member

scrthq commented Jul 31, 2019

Hey @Chris4678 - fix deploying now in v2.31.0! I'll ping here once available in PSGallery, should be about 10 minutes

@scrthq
Copy link
Member

scrthq commented Jul 31, 2019

annnnnd update when you can and let me know!

@Chris4678
Copy link
Author

It works! Thanks so much!

@scrthq
Copy link
Member

scrthq commented Jul 31, 2019

You bet!

Sent with GitHawk

@sigvaldhoy
Copy link

Hi @scrthq ,
I hope you can help me, I'm having this issue in v.2.36.4

Trying to update using:
Update-GSOrganizationalUnit -OrgUnitID idOfOrgUnit -Description "New description" -Verbose

Output:

VERBOSE: Updating OrgUnit ''
Update-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
+ Update-GSOrganizationalUnit -OrgUnitID "id:03ph8a2z0t0cibm" -Descript ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Update-GSOrganizationalUnit

And trying to use path:
Update-GSOrganizationalUnit -OrgUnitPath /root_org_unit/target_org_unit -Description "New description" -Verbose

Output:

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 C:\Program Files\WindowsPowerShell\Modules\PSGSuite\2.36.4\PSGSuite.psm1:22467 char:21
+ ...             Get-GSOrganizationalUnit -SearchBase $OrgUnitPath -Search ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GSOrganizationalUnit
 
VERBOSE: Updating OrgUnit '/root_org_unit/target_org_unit'
Update-GSOrganizationalUnit : You cannot call a method on a null-valued expression.
At line:1 char:1
+ Update-GSOrganizationalUnit -OrgUnitPath /root_org_unit/target_org_unit ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Update-GSOrganizationalUnit

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

No branches or pull requests

3 participants