Skip to content
Draft
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 @@ -9,7 +9,7 @@ function Get-EntraInactiveSignInUser {
# User Last Sign In Activity is before Days ago
[Parameter(ValueFromPipeline = $true, Position = 1)]
[Alias("BeforeDaysAgo")]
[ValidateRange(0,30)]
[ValidateRange(0, [int]::MaxValue)]
[int] $LastSignInBeforeDaysAgo = 30,
# Return results for All, Member, or Guest userTypes
[ValidateSet("All", "Member", "Guest")]
Expand Down Expand Up @@ -109,4 +109,3 @@ function Get-EntraInactiveSignInUser {
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Get-EntraBetaInactiveSignInUser {
# User Last Sign In Activity is before Days ago
[Parameter(ValueFromPipeline = $true, Position = 1)]
[Alias("BeforeDaysAgo")]
[ValidateRange(0,30)]
[ValidateRange(0, [int]::MaxValue)]
[int] $LastSignInBeforeDaysAgo = 30,
# Return results for All, Member, or Guest userTypes
[ValidateSet("All", "Member", "Guest")]
Expand Down Expand Up @@ -107,5 +107,3 @@ function Get-EntraBetaInactiveSignInUser {
}
}
}


7 changes: 7 additions & 0 deletions test/Entra/Users/Get-EntraInactiveSignInUser.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ Describe 'Get-EntraInactiveSignInUser' {
$result[2].UserID | Should -Be "user3"
}

It "Should allow LastSignInBeforeDaysAgo above 30" {
$result = Get-EntraInactiveSignInUser -LastSignInBeforeDaysAgo 90 -UserType "All"

$result | Should -Not -BeNullOrEmpty
Should -Invoke -CommandName Invoke-GraphRequest -ModuleName Microsoft.Entra.Users -Times 1
}

It "Should return only inactive Member users" {
$result = Get-EntraInactiveSignInUser -LastSignInBeforeDaysAgo 30 -UserType "Member"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ Describe 'Get-EntraBetaInactiveSignInUser' {
$result[2].UserID | Should -Be "user3"
}

It "Should allow LastSignInBeforeDaysAgo above 30" {
$result = Get-EntraBetaInactiveSignInUser -LastSignInBeforeDaysAgo 90 -UserType "All"

$result | Should -Not -BeNullOrEmpty
Should -Invoke -CommandName Invoke-GraphRequest -ModuleName Microsoft.Entra.Beta.Users -Times 1
}

It "Should return only inactive Member users" {
$result = Get-EntraBetaInactiveSignInUser -LastSignInBeforeDaysAgo 30 -UserType "Member"

Expand Down