wierd output

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi all,

I just got this script to get the SID's from the local accounts, but it
is retrieving all sids from Active Directory. How can I limit it to the
local machine?

Here is the script:

*******************************************************************************************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\CIMV2")
Set colCSItems = objWMIService.ExecQuery("SELECT * FROM
Win32_UserAccount")
For Each objCSItem In colCSItems
WScript.Echo "User Name: " & objCSItem.Domain & "\" & objCSItem.Name
& " " & "sID: " & objCSItem.SID
Next
*******************************************************************************************************

Thanks in advance,

Mike

.



Relevant Pages

  • Re: Printer Watermarks
    ... printing Microsoft documents, you can add in a function as some VBA ... with this VB Script: ... Set colCSItems = objWMIService.ExecQuery("SELECT * FROM ...
    (microsoft.public.scripting.vbscript)
  • Re: CSCRIPT
    ... not have local accounts. ... The script works great under ... >an administrator but when regular users try it, ... >CSCRIPT command comes back with Access denied. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: How to change PASSWORD expiration settings with command line?
    ... Now i have to write a script to do this, on all my local accouns (FTP ... External Users) with names begining with "ftp" or to generate a .TXT of users ... I have several LOCAL accounts created and i wanna to disable PASSWORD ... I found a Script (Modify a Local User Account So It Never Expires) in ...
    (microsoft.public.windows.server.scripting)
  • Re: Need help about script
    ... Just a dump question. ... How can I run that script? ... Look for deleting local accounts under ... I received a spreadsheet from department every 2 weeks regarding ...
    (microsoft.public.windows.server.scripting)
  • Re: script works on W2K Pro but not W2K member servers
    ... > I have a script which looks for local accounts which have the password ... > doesn't expire property set and removes it. ... the script pasted below works just find on ... property for the user it fails on? ...
    (microsoft.public.scripting.vbscript)