Google Answers Logo
View Question
 
Q: Missing User Account ( No Answer,   2 Comments )
Question  
Subject: Missing User Account
Category: Computers > Programming
Asked by: jaepark-ga
List Price: $150.00
Posted: 30 Jul 2003 17:48 PDT
Expires: 25 Aug 2003 12:27 PDT
Question ID: 237165
I am using the following Visual Basic function to retrieve all the users
in our network system . 

" Dim objset  As SWbemObjectSet
  Dim obj     As SWbemObject

   Set objset = GetObject("winmgmts:{impersonationLevel=impersonate}"). _
                                      InstancesOf("Win32_userAccount")
   
   On Local Error Resume Next

   For Each obj In objset

      With List1
         .AddItem "Caption: " & obj.Caption
      End With        
   Next "

But this function does not retrieve all the users . It only retreives 
certain number of records . In case of our company , 
It only retrieves 877 users and all the others are lost .
Even though I applied this function to VB Script , Visual Basic and .Net ,
I still Only got 877 records and all the others are lost .
And I also used WQL query 
         ExecQuery("Select * from Win32_userAccount where name > 'u' ")
    to retrieve all the users whose name is greater than 'u' in order
    to find out whether the missing users could be shown  
    ,but I still found the others are missing .

I am beginning to wonder whether it is a network or system issue .
In case , we are using Novell Server.

Please advise .
Thanks .
Answer  
There is no answer at this time.

Comments  
Subject: Re: Missing User Account
From: wazerface-ga on 15 Aug 2003 13:23 PDT
 
This is a crazy solution, but then again VB acts weird sometimes...

" Dim objset  As SWbemObjectSet 
  Dim obj     As SWbemObject 
 
   Set objset = GetObject("winmgmts:{impersonationLevel=impersonate}"). _ 
                                      InstancesOf("Win32_userAccount") 
    
   On Local Error Goto EnumComplete
 
   Do While True
      For Each obj In objset 
         With List1 
            .AddItem "Caption: " & obj.Caption 
         End With         
      Next "
   Loop

EnumComplete:
Subject: Re: Missing User Account
From: jaepark-ga on 19 Aug 2003 11:40 PDT
 
Wazerface-ga ,

I used your code , and I was getting infinite loop because there is no exit
point on your statement.
Thanks anyway .

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy