Archive for the 'Development' Category

LDAP Query based on account SID in VBscript

This is a bit of code I wish I’d found sooner. There is a - it seems mostly undocumented - feature of the ldap provider in Server 2003 that allows you to form an ldap query just on the SID of an account:

bindSid = "LDAP://<sid =" & SID & ">"
set oVal = GetObject(bindSid)
Result = oVal.Get("cn")
set oVal = Nothing

So if you have a list of SIDs and want to translate them into meaningful account names, this will do it without relying on using WMI - which on a lot of secure networks is locked down (or at least should be!).

Why do I need this? It’s a part of a larger script I’m writing that will archive specific Group Policy Objects from the \SYSVOL\<domainname>\Policies\ folder of a PDCe. One of the files in a GPO is the GptTmpl.inf file which gives a list of the User Rights Assignments (SeBackupPrivilege, SeShutdownPrivileg etc) along with the SIDs of the accounts that have been given those privileges (e.g. S-1-5-19). I wrote a script that reads the SIDs and queries the DC for the account names. This code fragment works more reliably (and I think faster) than the WMI calls I was previously using.

Graphing Counter-Strike Source FPS/Users in MRTG on Windows

Network Frames per Second In my last post, you discovered my obsession for generating statistics on my network usage and my use of MRTG to draw pretty little graphs. Writing that post got me thinking about my Counter-Strike server, and what data I could usefully graph from it. A bit of Googling led me to this page where a Dutch guy had used MRTG to graph the number of users and the network frames per second of his CS:S server - running on Ubuntu Linux.

Continue reading ‘Graphing Counter-Strike Source FPS/Users in MRTG on Windows’

VB.NET to C# and C# to VB.NET Translator

This code translator is very handy.  Give it some C# and it will spit out VB.NET, give it VB.NET and it’ll give you C#.  Some of the code samples for manipulating Word documents are in VB.NET and I wanted to see them in C#.  I could have tried to translate them myself but this saved me the bother.  Sweet.




Bad Behavior has blocked 412 access attempts in the last 7 days.