Skip to content

Instantly share code, notes, and snippets.

@benclaussen1
benclaussen1 / Test-ADAuthentication.ps1
Created October 4, 2022 19:33
Test-ADAuthentication Powershell Function
function Test-ADAuthentication {
<#
.SYNOPSIS
Creates a connection to DirectoryServices using the provided username and password.
.DESCRIPTION
Creates a connection to DirectoryServices using the provided username and password. If the connection is successful, returns $true, else $false.
.PARAMETER Username
The username to test.