瀏覽代碼

v1.1

v1.1
Runard 3 年之前
父節點
當前提交
60312b71ae
共有 2 個文件被更改,包括 15 次插入0 次删除
  1. 二進制
      Check365Password.exe
  2. 15 0
      Check365Password.ps1

二進制
Check365Password.exe


+ 15 - 0
Check365Password.ps1

@@ -0,0 +1,15 @@
+Write-Host -ForegroundColor Yellow "...::: Outil de vérification de mot de passe Microsoft 365 :::..."
+while(0 -lt 1){
+$Credential = Get-Credential
+Write-Host -ForegroundColor Yellow "Test de connexion en cours... " -NoNewline
+$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Credential -Authentication Basic -AllowRedirection
+Import-PSSession $Session | Out-Null
+
+if ($Error.Count -eq 0) {
+    Write-Host -ForegroundColor Green "Connexion OK !"
+}else{
+    Write-Host -ForegroundColor Red "Erreur de connexion ! Le mot de passe est-il correct ?"
+}
+
+Remove-PSSession $Session
+}