Microsoft Windows Server are very great products to work with. And,... server administrators and operators do not like to do stupid work or repeating tasks. That why I made this new category, to share my most favorite general scripts that I often use. This is not a scripting site, there are many more and better sites available for that. These scripts are just handy for common use. So, the initially set up was for my own references, but now I share it with you. Enjoy it !! Due to the fact that a big percentage of visitors of this page are international based, this article is in the english language.


Siddump vbs script:
This script has been made to quickly create an overview of all the sids of all users and groups within a domain. I use it some times to quickly find a username or group in case there is a problem or to find out which user belongs to a SID in the registry for instance. Feel free to copy this text. Save it with a name you want and you wil find out how handy it can be. You might want to change the location of file created. Most servers will not allow a script to save or create a new file into the operatingssystem root location.


Wscript.Echo "Begin dumping Users, Groups & SID's ?"

Dim strComputer, objFSO, objFile
Const ForAppending = 8
On Error Resume Next
strComputer = "."
strFile = "C:\UserSID.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile (strFile, ForAppending, True)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_UserAccount",,48)
For Each objItem in colItems
    objFile.WriteLine(objItem.Domain & "\" & objItem.Name & ";" & objItem.SID)
'    Wscript.Echo(objItem.Domain & "\" & objItem.Name & ";" & objItem.SID)
Next

Set colItems = objWMIService.ExecQuery("Select * from Win32_Group",,48)
For Each objItem in colItems
    objFile.WriteLine(objItem.Domain & "\" & objItem.Name & ";" & objItem.SID)
Next

Wscript.Echo "Finished dumping Users, Groups & SID's !"


I do not have to remind you, that you should always use scripts with care.
Therefore this posting is "as is" without express or implied warranty.


Printscreen: not available


-----------------------------------------------------------------------------------------------------

Ben OostdamBen Oostdam has been working with Windows systems since 1993. Worked for several companies as a system administrator, and is currently a Senior Support Engineer for Qurius Managed Services in the Netherlands.

Disclaimer: The information contained in this website/article is for general information purposes only. The information is provided as is, by Ben Oostdam and while we endeavour to keep the information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk. In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website. Through this website you are sometimes able to link to other websites which are not under my control. I have no control over the nature, content and availability of those sites. The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them. Every effort is made to keep the website up and running smoothly. However, I take no responsibility for, and will not be liable for, the website being temporarily unavailable due to technical issues beyond our control. All entries in these articles, are my individual opinion, or from co-writers and they don't necessary reflect the opinion of my employer.



 

Sunday the 20th, January 2019. All rights reserved.. // Oostdam WebDesign