More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  GilliathProfileFriendsFilesBlog Tools Explore the Spaces community

Blog

    December 09

    VBScript editor for OSX

    I love administering a Windows infrastructure with my MacBook. One of the things I'm looking for though is a script editor such as Sapien's PrimalScript that would allow me to write VBScript code. I realize there is no vbscript engine for OSX, which is not necessary. I would just like to manage my code on the Mac. Anyone got any suggestions?

    -Gill
    December 05

    Time to blog

    It's been some time since I posted an entry. I've accomplished to use my MacBook Pro (still running Tiger atm) to fully administer a client's Windows environment. Granted, most of the administration is via Remote Desktop lol! OK, that's all I got to say for the moment...life is calling...


    GillRilla
    November 24

    Having fun on the Mac

    Now that I've had this awesome laptop for a few days let me tell what I've been doing. I'm not very Mac savvy so please excuse my OS X inexperience.

    One of the first things I wanted to do was test dual booting with XP SP2. I tried rEFIt and Bootcamp. rEFIt seemed very powerful and upon installation, I realized I was in for some reading to understand EFI and everything around dual booting on Macs. I decided to go with Bootcamp instead, opting for its simplicity and wizards. Installing XP was a complete breeze and during the whole process I never lost functionality of my Logitech Bluetooth mouse (Model M-RBB93) which was a cool nicety. Even the Mac's built-in camera was recognized in XP! The next couple of hours were spent installing City of Heroes/City of Villains, including it's updates (I have an old install CD so the update was 1.6GB!). Now for the ultimate test (at least in my mind)...COH/COV ran so good I'm still beside myself! The game itself informs me that I am using an outdated graphics driver for the ATI X1600, but its performance still excellent. I am comparing the game play to running it on an Alienware Area-51m P4 3.2Ghz laptop using the InVidia Go 5600 chipset. I realize we are talking apples and oranges here, but it was very comforting to know that I can use my Mac at work (I will talk about my transition in future blogs) and run XP based games at home without issue.

    -Gill
    November 18

    Official Member

    About a month ago I started on the journey to Mac'dom. I had decided that owning a MacBook Pro was going to be a sweet notch on my geek belt. Because I figured that the introduction of the Core 2 Duo chipset wasn't going to make it in the MacBook Pro anytime soon I dropped the bucks and ordered the MacBook Pro Core Duo version. While commuting to work the package arrived on my doorstep. When I got to work, I found out that Apple had announced the Core 2 Duo version! I looked at the new specs and reluctantly decided not to open the Core Duo version and sent it back to order the new one. After waiting a couple of weeks and driving more than an hour to a FedEx facility (apparently they can't find my 1970's house or its neighborhood thats been around for more than 40 years), waiting for 2 hours for the driver to come back from his route, I am now writing this article on my new MacBook Pro Core 2 Duo! I'm officially...official! Now to download ReFit and BootCamp.... -Gill
    September 21

    MacBook Pro

    I understand that there is an expo in Germany (Photokina) the 25th of this month and there may be an announcement for a bump in CPU speed for the MacBook Pro.

    A recent article (http://www.macshrine.com/2006/09/15/merom-macbook-pro-at-photokina/) suggested that the Core 2 Duo MacBooks would not come out until Q1/Q2 of 2007. Either way, by the end of September, I am getting a MacBook Pro 17" at the fastest speed available. My computing knowledge is fairly wide, but it will be interesting to see how this mostly Microsoft-centric geek adapts to the "white" side.

    -Gill
    September 19

    Local Administrators Group Enumeration

    I can't take all the credit for this script, some of it came from a source that I honestly don't remember. I usually find interesting snippets when looking for something else and save them to my /Snippets directory. This project came about because I needed a way to collect the members of a PC's local Administrators group into an SMS database. I could not find a good way to do it so I came up with a 2 step process;

    1. Run a script on the PC that stuffs a registry key with the members of the local Administrators group
    2. Configure the SMS_DEF.MOF to collect the registry key.

    The first part is what this blog post is about; the vbscript. I will start with the following snippet:

    Dim oNetwork, sComputer, oLocalGroup, aUsers

    Set oNetwork = CreateObject("Wscript.Network")
    sComputer = oNetwork.ComputerName

    Set oLocalGroup = GetObject("WinNT://" & sComputer & "/Administrators,group")

    For Each oMember In oLocalGroup.Members
    aUsers = Split(oMember.AdsPath, "/")
    WScript.Echo aUsers(UBOUND(aUsers)-1) & "\" & aUsers(UBOUND(aUsers))
    Next

    Very simple really. When the AdsPath of a user is returned, it looks like this WinNT://XXX/YYY/ZZZ if it is a local account (user or group) or WinNT://XXX/ZZZ if it is a domain account (user or group). XXX = Workgroup or Domain name, YYY = Server name, ZZZ = account name (user or group). You will notice that if you take each line and split it into elements separated by the forward slash '/', the last two elements are always what we want. The line
    WScript.Echo aUsers(UBOUND(aUsers)-1) & "\" & aUsers(UBOUND(aUsers)) takes the second to last and last elements and puts them together in the familiar DOMAIN\Account format.

    With a little more editing, I was able to stuff the registry with the "rebuilt" account name;

    Dim oShell, oFSO, oNetwork, sComputer, oLocalGroup, aUsers

    Set oShell = Wscript.CreateObject("Wscript.Shell")
    Set oFSO = CreateObject("Scripting.FileSystemObject")

    Set oNetwork = CreateObject("Wscript.Network")
    sComputer = oNetwork.ComputerName

    Set oLocalGroup = GetObject("WinNT://" & sComputer & "/Administrators,group")
    x = 1
    For Each oMember In oLocalGroup.Members
        aUsers = Split(oMember.AdsPath, "/")
        oShell.RegWrite "HKLM\SYSTEM\MYCOMPANYSINFO\Security\LocalGroup\Administrators\Member" & x, aUsers(UBOUND(aUsers)-1) & "\" & aUsers(UBOUND(aUsers)), "REG_SZ"
        x = x + 1
    Next

    Wscript.Quit(0)


    Note that the oShell.RegWrite line is continuous through the "REG_SZ". This window may have broken it up.

    The result is that in the desired registry key, you will have Member1, Member2, etc with their values set to the member name.

    -Gill
    September 11

    The XBOX Project - Media Services

    I confirmed my suspicion that I would not be able to use the library of music I have on my servers via the XBOX 360. At least not without some kind of hack because the media services will not install on a Server 2003 box. I tried installing the media connect software on my laptop, mapped a drive to the library on my network and deleted & re-created the Shared Music share to the network drive. No dice.

    So, my next task is to create an XP VM on my Server 2K3 box and assign a drive letter to the RAID drive on the server.

    -GillRilla

    Averatec 7100 Series Laptop

    OK, I couldn't help myself. I recently purchased an Averatec 17" laptop for my wife and decided it would be cool to get one myself. Now, I didn't really need it and it isn't more powerful than my Alienware laptop (Area-51m, Cyborg green, 16.1" display, 3.2Ghz HT, 1GB Ram, nVidia Go 5600, 60GB 7200rpm drive, WOOT!) but its weight and thickness makes it nice to have for some web surfing, programming and blogging at the local coffee shop or around the house. It actually can run City of Heroes fairly decently because of its ATI Radeon Xpress 200M video card and AMD Turion 64bit CPU. I'm thinking if I beef it up to 1GB ram or more, and plug into my switch, I will improve the online gaming experience.

    I decided to try a couple 64-bit OSs very briefly to see what they would do out-of-the-box so to speak. I first tried Redhat FC5 x386 64-bit...out-of-the-box it had no sound or network support (I don't have alot of Linux experience, but this seems par for the course) and used generic video drivers. I didn't feel like going through the motions of getting the network going, but I read some articles about using the NDIS wrapper (which I have used successfully with my Alienware) for the Ralink card in the Averatec. Then I decided to try XP Pro 64-bit, and again, out-of-the-box there was no graphic or network drivers that worked. I know that there are 64-bit drivers for the ATI card, but I did not find anything that would get the network going (wireless or LAN). I didn't invest alot of time in my research because I decided to wait until Vista was available. Maybe I will try Vista RC1...In the mean time, I restored the laptop back to XP Pro 32-bit.

    -GillRilla
    August 16

    Dual Boot a MacBook Pro

    Just got wind from a Mac buddy of mine that there is an application (BootCamp) that allows one to dual boot a Mac (in his case a MacBook Pro) with XP SP2 and the Mac OS. I don't know too much about Macs...yet; however this sounds fantastic to me. I currently have a Cyborg Green Alienware Area-51m notebook (dual booting Redhat/XP SP2) and love it to death. But the geek inside me loves the feel of the Mac OS, at least for as much as I have seen/played with it, and to be able to play XP based 3D games like City of Heroes/Villains (been playing since CoH beta) and the different games on my Steam account, and then be able to switch to the Mac side (which I understand is a Linux core) and run security apps? This has me quaking with anticipation! I will take my buddy's advice and wait until the rumored MacBook Pro Core 2 Duo is out.

    Gill
    August 12

    Compund command symbols

    There are a few cases where I need a batch script to do one thing, and if it fails, do another. There is something that has been around since Windows NT 4.0 to help us create these conditional branches.

    The command shell supports running multiple commands on one line. You probably have seen this using the & symbol. The following is a table of compound command sybols and their use:

    Symbol                    Use
    ------------------------------------------------------------------------------------------
    Cmd1 & cmd2           Executes command cmd1, then command cmd2.
                                 Additional commands can be added using additional ampersand symbols.

    Cmd1 && cmd2         Executes command cmd1, then executes command cmd2 only if cmd1 completed successfully.

    Cmd1 || cmd2          Executes command cmd1, then executes command cmd2 only if cmd1
                                 did not complete successfully.

    ( )                          Use parentheses to indicate the nesting of complex multi-command sequences.
    ------------------------------------------------------------------------------------------

    In effect, this helps us create an AND and/or an OR conditional branch in our scripts.

    Consider the following script where I will use the double ampersand && and the double pipe ||:

    I want to create a script that will ping all workstations and give me a file on non-pingable addresses and and a file on pingable addresses…

    For /f %a IN (computerlist.txt) Do @(ping -n 1 %a | find /i /c "Request timed out" >NUL && echo %a: No Reply && echo %a >> noreply.txt) || (ping -n 1 %a | find /i /n "Reply from" >NUL && echo %a: Pingable && echo %a >> pingable.txt)

    The above script will ping a list of workstations and create two lists, one of computers that did not respond to a ping (noreply.txt) and another that did respond to a ping (pingable.txt) while giving us some output on the screen as well.

    To ping a subnet, we can change the For..In..Do loop to process a number set:

    For /l %a IN (1,1,255) Do @(ping -n 1 192.168.1.%a | find /i /c "Request timed out" >NUL && echo %a: No Reply && echo %a >> noreply.txt) || (ping -n 1 192.168.1.%a | find /i /n "Reply from" >NUL && echo %a: Pingable && echo %a >> pingable.txt)

    The above script would ping 192.168.1.1 through 192.168.1.255 and produce the same output files as above.

    The examples above are just to show the possibilities of using compund command symbols and may need to be edited for your specific environment and/or use.

    Gill