Assuming I ask the user for username and password, how can I compare that data to an AD group to make sure this user is member of a group and also the user has entered the right password for his or her account? I'm planning on creating a tool that would only allow users member of a group to use the tool.
$Username = Read-Host 'What is your username?'
Param(
[Parameter(Mandatory=$true, Position=0, HelpMessage="Password?")]
[SecureString]$password
)
$pw = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))