Archive for March 2010

Courion Tip dsquery / dsget formatting output… vbscript…

Courion Tip – Collecting group membership information from Active Directory….
I found this batch file (below) on the internet (and will paste a link whenever I can find where I got it from!!!) HOWEVER, the format of the output was less than idea. What I REALLY wanted was something like this: {Please note that if you copy and paste any of this, you will probably get the wrong quotation marks and the code won’t work. So, paste it into notepad, then manually edit it to put the correct quotation marks back in!!}

GroupName1 Member1
GroupName1 Member2
GroupName2 Member1
GroupName2 Member2
GroupName2 Member3
etc… etc…. etc…

Here’s the code to generate the group membership information

@echo off
if exist membership.txt del membership.txt
dsquery group -limit 0 >groups.txt

pause
::The FOR command is one single line
for /f “tokens=*” %%g in (groups.txt) do @echo Group Name: %%g >>membership.txt && echo Members: >>membership.txt && dsget group %%g -members -l >>membership.txt && echo **************************************** >>membership.txt

::display result
notepad membership.txt

Here’s the visual basic script I wrote to reformat it….

Dim fso
Dim InputFile
Dim OutputFile
Dim keyword
Dim retstring
Dim GroupName
Dim keywordlength

InputFile =”c:\membership.txt”
OutputFile =”c:\outputfile.txt”
keyword =”Group Name: ”
keywordlength = len(keyword)

Const ForReading = 1
Const ForWriting = 2
Set fso = CreateObject(“Scripting.FileSystemObject”)
Set infile = fso.OpenTextFile(InputFile, ForReading)
Set outfile = fso.CreateTextFile(OutputFile, ForWriting)

Do until infile.AtEndOfStream = True
retstring = infile.ReadLine
If (len(retstring)>2) then ‘skip blank lines
If left(retstring, keywordlength) = keyword Then ‘look for whatever text was defined at the top of this file as the keyword
numofchars = (len(retstring)-keywordlength)
Groupname = right(retstring, numofchars)
retstring =”” ‘since this is the GroupName and not a member line set retstring to blank
Elseif left(retstring, 1) = “M” Then ‘skip lines that start with the word Member…
retstring =””
Elseif left(retstring, 1) = “*” Then ‘skip lines that are just astericks…
retstring =””
end if

retstring = Groupname&retstring&VbCrLf
If len(retstring)>len(Groupname)+3 Then outfile.Write(retstring) ‘if the output line would just contain the group name then don’t bother
end if
Loop

infile.Close
outfile.Close

Now I have the output that I want

========

Also check out this https://mmdmurphy.wordpress.com/2012/06/07/courin-tip-ldapad-queries/

Posted March 24, 2010 by mmdmurphy in Courion Tip, freeware, tips, windows

Tagged with , , ,

Wireless   Leave a comment

Here’s a neat little utility that shows you wireless traffic near you. I used it (mostly) to figure out why I was getting such a bad connection to my own wireless. Turns out there were LOTS of routers set to use channel 6 near me, so I simply moved to a different (nearly empty) channel.
HIGHLY recommended.
http://www.metageek.net/support/downloads

http://www.tlpcrepair.com/index.php?option=com_content&view=article&id=82:chanalyzer-3&catid=36:security&Itemid=62

Posted March 20, 2010 by mmdmurphy in freeware, security, tips, windows

Tagged with

Upgrade note to myself   Leave a comment

http://www.pcper.com/article.php?aid=882&type=expert&pid=8
http://www.pcper.com/article.php?aid=411

I asked someone about upgrading my pc, and here’s what they said:

You didn’t say what your main apps are. If you’re gaming, I’d look at an AMD
Radeon HD 5850 or 5770. The 5850 is about as high as I’d want to go with the
PSU in the Pavilion. Both cards should give you a healthy speed bump in
games over the GTS 250.

Posted March 18, 2010 by mmdmurphy in Uncategorized

Open source home server

I have been very interested in Windows Home Server, but not interested enough to actually do anything about it. HOWEVER, this looks very interesting. It’s basically a Linux alternative to the same solution.
Here’s where I found out about it:
http://twit.tv/floss112
http://wiki.twit.tv/wiki/FLOSS_Weekly_112
And here’s the link to the project itself:
http://www.amahi.org/

Posted March 17, 2010 by mmdmurphy in freeware, Internet, Linux, Podcasts

Tagged with

Copy and Paste   Leave a comment

I have been frustrated by the whole copy and paste thing. After all, why is it that there is only one “buffer” to copy and paste from? So, I found this:
http://ditto-cp.sourceforge.net/ and am trying it. Sorry, I can’t say how good it is, I haven’t been using it too long..

Posted March 14, 2010 by mmdmurphy in freeware, tips, windows

Tagged with

SAML   Leave a comment

We have an application at work that looks like it requires SAML. Here’s a video I found that seems to pretty much describe it.
http://www.infoq.com/presentations/saml
===============
http://www.windowsitpro.com/article/federated-security/Generate-SAML-Tokens-Using-Windows-Identity-Foundation.aspx

Posted March 3, 2010 by mmdmurphy in Internet, security