Create a function to set the tenant alias in CIPP - #96
Open
jonwbstr wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new tenant administration cmdlet intended to update CIPP tenant properties, especially tenant aliases, through the /api/EditTenant endpoint.
Changes:
- Adds a new public PowerShell script for setting tenant properties.
- Builds a request body with customer ID, tenant alias, and tenant groups.
- Calls
Invoke-CIPPRestMethodwithPOSTagainst/api/EditTenant.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [string]$TenantAlias, | ||
|
|
||
| [Parameter(Mandatory = $true)] | ||
| [hashtable][]$TenantGroups = @(), |
Comment on lines
+34
to
+35
| [Parameter(Mandatory = $true)] | ||
| [hashtable][]$TenantGroups = @(), |
| $body = @{ | ||
| customerId = $CustomerTenantID | ||
| tenantAlias = $tenantAlias | ||
| tenantGroups = $tenantGroups |
kris6673
reviewed
May 27, 2026
| Set-CIPPTenantProperty -CustomerTenantID "12345678-1234-1234-1234-1234567890ab" -TenantAlias "Contoso, LLC" -TenantGroups | ||
| Adds or updates the TenantAlias and TenantGroups for the specified tenant. | ||
| #> | ||
| function Set-CIPPCustomVariable { |
Collaborator
There was a problem hiding this comment.
Function name should be the same as the file name. You reference 3 names in total:
- Set-CIPPTenantProperty
- Set-CIPPTenantProperties
- Set-CIPPCustomVariable
I'm guessing you want it to be named Set-CIPPTenantProperty? :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You need to get the current groups to run this command and keep the existing groups I don't use tenant groups and did not look into how that could be done.
This is what I used prior to making this function:
This is what I will use when syncing names manually in the future: