From 13b8ecd7330601c896d74ddc2dd035f5cc85a532 Mon Sep 17 00:00:00 2001 From: rgconrad514 Date: Mon, 23 Apr 2018 09:38:54 -0700 Subject: [PATCH] Log-FailedLogin function accept empty string Fixed Log-FailedLogin function to accept empty string values for $UserID and $Message arguments. --- .../SQL Server Login Monitor/LoginMonitor.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SQL Server Login Monitor/SQL Server Login Monitor/LoginMonitor.ps1 b/SQL Server Login Monitor/SQL Server Login Monitor/LoginMonitor.ps1 index fbb7c94..94bea82 100644 --- a/SQL Server Login Monitor/SQL Server Login Monitor/LoginMonitor.ps1 +++ b/SQL Server Login Monitor/SQL Server Login Monitor/LoginMonitor.ps1 @@ -112,9 +112,11 @@ function Log-FailedLogin [string] $IPAddress, [parameter(position = 3, Mandatory=$true)] + [AllowEmptyString()] [string] $UserID, [parameter(position = 4, Mandatory=$true)] + [AllowEmptyString()] [string] $Message ) @@ -332,4 +334,4 @@ function On-FailedLogin $Connection.Close() $Connection.Dispose() } -} \ No newline at end of file +}