Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ function Add-EntraBetaAdministrativeUnitMember {
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Unique ID of the administrative unit.")]
[System.String] $AdministrativeUnitId
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes AdministrativeUnit.ReadWrite.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ function Add-EntraBetaCustomSecurityAttributeDefinitionAllowedValue {
[System.String] $CustomSecurityAttributeDefinitionId
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes CustomSecAttributeDefinition.ReadWrite.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ function Add-EntraBetaDeviceRegisteredOwner {
[System.String] $OwnerId
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Directory.AccessAsUser.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ function Add-EntraBetaDeviceRegisteredUser {
[System.String] $UserId
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Device.ReadWrite.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ function Add-EntraBetaScopedRoleMembership {
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[System.String] $AdministrativeUnitId
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes RoleManagement.ReadWrite.Directory' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ function Confirm-EntraBetaDomain {
[Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $false, HelpMessage = "Allows external admin takeover of an unmanaged domain. Default is false.")]
[System.Boolean] $ForceTakeover
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Domain.ReadWrite.Directory' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$body = @{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ function Enable-EntraBetaDirectoryRole {
[System.String] $RoleTemplateId
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes RoleManagement.ReadWrite.Directory' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ function Get-EntraBetaAccountSku {
[System.Guid] $TenantId
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Organization.Read.All, LicenseAssignment.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ function Get-EntraBetaAdministrativeUnit {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes AdministrativeUnit.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ function Get-EntraBetaAdministrativeUnitMember {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes AdministrativeUnit.ReadWrite.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ function Get-EntraBetaAttributeSet {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes CustomSecAttributeDefinition.ReadWrite.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ function Get-EntraBetaContact {
[Alias("Select")]
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes OrgContact.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ function Get-EntraBetaContactDirectReport {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes OrgContact.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ function Get-EntraBetaContactManager {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes OrgContact.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ function Get-EntraBetaContactMembership {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes OrgContact.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ function Get-EntraBetaContract {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Directory.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$keysChanged = @{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ function Get-EntraBetaCustomSecurityAttributeDefinition {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes CustomSecAttributeDefinition.Read.All, CustomSecAttributeDefinition.ReadWrite.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ function Get-EntraBetaCustomSecurityAttributeDefinitionAllowedValue {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes CustomSecAttributeDefinition.ReadWrite.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ function Get-EntraBetaDeletedAdministrativeUnit {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes AdministrativeUnit.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ function Get-EntraBetaDeletedDevice {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Device.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ function Get-EntraBetaDeletedDirectoryObject {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes AdministrativeUnit.Read.All, Application.Read.All, Group.Read.All, User.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ function Get-EntraBetaDevice {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Device.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ function Get-EntraBetaDeviceRegisteredOwner {
[Alias("Select")]
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Device.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ function Get-EntraBetaDeviceRegisteredUser {
[System.String[]] $Property
)

begin {
# Ensure connection to Microsoft Entra
if (-not (Get-EntraContext)) {
$errorMessage = "Not connected to Microsoft Graph. Use 'Connect-Entra -Scopes Device.Read.All' to authenticate."
Write-Error -Message $errorMessage -ErrorAction Stop
return
}
}

PROCESS {
$params = @{}
$customHeaders = New-EntraBetaCustomHeaders -Command $MyInvocation.MyCommand
Expand Down
Loading