Monthly Archives: September 2012

Powershell function to check if Active Directory users exists

Here is a little powershell function I made to see check if specific active directory users exists or not. #POWERSHELL function userExists ([string]$name){ #written by: √ėyvind Nilsen (oyvindnilsen.com) [bool]$ret = $false #return variable $domainRoot = [ADSI]” $dirSearcher = New-Object System.DirectoryServices.DirectorySearcher($domainRoot) … Continue reading

Posted in Scripting | Tagged , , , , , , , , , | Leave a comment

One line in powershell to check if remote port is open

Here is an easy way to use powershell to see if a remote machine is listening on a specific port. If the command finishes without returning anything the remote machine is listening on the port. If the commands times out … Continue reading

Posted in Scripting | Tagged , , , , , , , , , , , | Leave a comment