Skip to content

Commit 5364025

Browse files
Remove-DbaDbOrphanUser, avoid readonly dbs (#9704)
1 parent 33e1076 commit 5364025

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

public/New-DbaAgentJobStep.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ function New-DbaAgentJobStep {
4242
.PARAMETER OnSuccessAction
4343
The action to perform if the step succeeds.
4444
Allowed values "QuitWithSuccess" (default), "QuitWithFailure", "GoToNextStep", "GoToStep".
45-
The text value van either be lowercase, uppercase or something in between as long as the text is correct.
45+
The text value can either be lowercase, uppercase or something in between as long as the text is correct.
4646
4747
.PARAMETER OnSuccessStepId
4848
The ID of the step in this job to execute if the step succeeds and OnSuccessAction is "GoToStep".
4949
5050
.PARAMETER OnFailAction
5151
The action to perform if the step fails.
52-
Allowed values "QuitWithSuccess" (default), "QuitWithFailure", "GoToNextStep", "GoToStep".
53-
The text value van either be lowercase, uppercase or something in between as long as the text is correct.
52+
Allowed values "QuitWithFailure" (default), "QuitWithSuccess", "GoToNextStep", "GoToStep".
53+
The text value can either be lowercase, uppercase or something in between as long as the text is correct.
5454
5555
.PARAMETER OnFailStepId
5656
The ID of the step in this job to execute if the step fails and OnFailAction is "GoToStep".

public/Remove-DbaDbOrphanUser.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function Remove-DbaDbOrphanUser {
118118
Stop-Function -Message "Failure" -Category ConnectionError -ErrorRecord $_ -Target $instance -Continue
119119
}
120120

121-
$DatabaseCollection = $server.Databases | Where-Object IsAccessible
121+
$DatabaseCollection = $server.Databases | Where-Object IsAccessible | Where-Object ReadOnly -eq $false
122122

123123
if ($Database) {
124124
$DatabaseCollection = $DatabaseCollection | Where-Object Name -In $Database

0 commit comments

Comments
 (0)