Expert Answer Center > Experts On Demand > View Answer
EMAIL THIS
Experts on Demand
  EXPERTS ON DEMAND HOME     POSE A QUESTION     VIEW ANSWERS     BROWSE BY TOPIC        RSS FEEDS  
Is there a way I can check for the existence of a specific user account in the domain? QUESTION POSED ON: 01 JUL 2004
QUESTION ANSWERED BY: Rod Trent You can use the following VB Script to verify that an individual already has an account in the domain. Replace the text in bold with your specific information.
Dim oUser, oDomain
Set oDomain = GetObject("WinNT://"&sDomainName)
oDomain.Filter = Array("user")

For Each oUser In oDomain
If LCase(oUser.Name) = LCase(sUserName) Then
WScript.Echo oUser.Name & " already has an account."
WScript.Quit
End If
Next
HomeExperts on DemandIT Expert Webcast SeriesExpert KnowledgebaseSite Index
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts