-
Notifications
You must be signed in to change notification settings - Fork 0
AzDoOrganizationGroup
Michael Zanatta edited this page Aug 13, 2026
·
1 revision
The AzDoOrganizationGroup DSC resource is used to create and manage groups at the organization level in Azure DevOps. These groups can be used for managing permissions and organizing users at the organizational scope.
AzDoOrganizationGroup [string] #ResourceName
{
GroupName = [String] $GroupName
[ Ensure = [String] {'Present', 'Absent'} ]
[ GroupDescription = [String] $GroupDescription ]
[ DependsOn = [String[]] ]
[ PsDscRunAsCredential = [PSCredential] ]
}- GroupName [String] - The name of the organization group. This uniquely identifies the group within the organization.
-
Ensure [String] - Desired state of the resource:
-
'Present'- (default) Group should exist -
'Absent'- Group should be removed
-
-
GroupDescription [String] - A description for the organization group that explains its purpose.
-
DependsOn [String[]] - Dependencies on other resources.
-
PsDscRunAsCredential [PSCredential] - Credentials to run this resource under.
The resource returns the following properties:
- GroupName - The name of the group
- Ensure - Current state ('Present' or 'Absent')
- GroupDescription - The description of the group
- GroupId - The unique identifier of the group
Configuration CreateOrgGroup {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoOrganizationGroup 'DevelopersGroup' {
Ensure = 'Present'
GroupName = 'Developers'
GroupDescription = 'All developers in the organization'
}
}
}
CreateOrgGroup
Start-DscConfiguration -Path ./CreateOrgGroup -Wait -VerboseConfiguration CreateMultipleOrgGroups {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoOrganizationGroup 'AdminsGroup' {
Ensure = 'Present'
GroupName = 'Administrators'
GroupDescription = 'Organization administrators with full access'
}
AzDoOrganizationGroup 'ReadersGroup' {
Ensure = 'Present'
GroupName = 'Readers'
GroupDescription = 'Users with read-only access'
}
AzDoOrganizationGroup 'ContributorsGroup' {
Ensure = 'Present'
GroupName = 'Contributors'
GroupDescription = 'Users who can contribute to projects'
}
}
}
CreateMultipleOrgGroups
Start-DscConfiguration -Path ./CreateMultipleOrgGroups -Wait -VerboseConfiguration RemoveOrgGroup {
Import-DscResource -ModuleName 'AzureDevOpsDscNative'
Node localhost {
AzDoOrganizationGroup 'RemoveOldGroup' {
Ensure = 'Absent'
GroupName = 'OldTeam'
}
}
}
RemoveOrgGroup
Start-DscConfiguration -Path ./RemoveOrgGroup -Wait -Verbose# Get the current state
$properties = @{
GroupName = 'Developers'
}
$result = Invoke-DscResource -Name 'AzDoOrganizationGroup' `
-Method Get `
-Property $properties `
-ModuleName 'AzureDevOpsDscNative'
Write-Host "Group: $($result.GroupName)"
Write-Host "Description: $($result.GroupDescription)"- Organization groups are created at the organizational level
- They can be used across all projects within the organization
- Members can be added using
AzDoGroupMember - Permissions can be assigned using
AzDoGroupPermission
- Group names must be unique within the organization
- Names are case-insensitive for identification
- Use descriptive names that reflect the group's purpose
Some organizations may have built-in groups that cannot be deleted:
- Project Collection Administrators
- Project Collection Valid Users
- Project Collection Test Service Accounts
Cause: A group with the same name already exists
Solution:
- Use a unique group name
- Or remove the existing group first
Cause: Authentication account lacks permissions
Solution:
- Verify user is in Project Collection Administrators
- Check Personal Access Token has appropriate scope
- AzDoGroupMember - Add members to organization groups
- AzDoGroupPermission - Manage group permissions
- AzDoProjectGroup - Create project-level groups
- AzDoUserEntitlement - Manage user entitlements