$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
Function below can be used to check if a given Username exists in Active Directory:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | function UserExists([string]$Username) { $strFilter = "(&(objectCategory=person)(sAMAccountName=$Username))" $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.PageSize = 1000 $objSearcher.Filter = $strFilter $objSearcher.SearchScope = "Subtree" $colResults = $objSearcher.FindAll() return [bool]($colResults -ne $null) } |
Leave a reply