in

myITforum.com

Matt Broadstock at myITforum

Scripting away in Margaritaville

August 2005 - Posts

  • Getting NETSH to manage DHCP from XP

    I've always hated the fact that you can't do NETSH command from XP to manage DHCP. I've always had to RDP or PSEXEC into a server in order to run NETSH commands for DHCP.

    Today I stumbled across a technote describing how to get it to work so I figured I would share.

    netsh add helper dhcpmon.dll

    I did a quick comparison between a server and my workstation and it looks like the other services that you can't manage from XP are AAAA, IPSec and RPC.

    So, next I ran “netsh show helper“ on a server to see what DLLs were responsible for letting you manage those other services.

    I was able to add AAAA (whatever that is) by adding the helper for aaaamon.dll

    I tried adding nshipsec.dll and rpcnsh.dll to get RPC and IPSec but no dice. Oh well, I probably just don't have those DLLs on my system or something. And I never use NETSH to manage those services anyway.

  • Finally, a scientific study that I can use...

    If you've ever wondered whether you should pop a Red Bull or a few cups of coffee to get going, here's one man's ordeal with a bunch of caffeinated beverages and how effective they are at getting you in top form and how long you can expect the effect to last.

    http://www.tomshardware.com/column/200508271/index.html

    Posted Aug 30 2005, 09:59 AM by Anonymous with no comments
    Filed under:
  • Gmail available to everyone now

    But it requires validation via your cell phone. That's a bit of a crock. I'm glad I got my account a long time ago. I wonder if they are going to yank away your ability to send out invitations at some point and force all new users to sign up this way...

     

    http://www.betanews.com/article/Google_Opens_Gmail_Service_to_Public/1124983238

    https://www.google.com/accounts/SmsMailSignup1

     

    Posted Aug 29 2005, 12:36 PM by Anonymous with no comments
    Filed under:
  • WinFS Beta available in a month?

    Posted Aug 29 2005, 12:30 PM by Anonymous with no comments
    Filed under:
  • RE: Lock Down Users

    In response to James' message.

    I've always found RegMon and FileMon to be invaluable tools for getting applications to work as restricted users. And they are awesome troubleshooting tools as well. It's interesting to see how much is actually going on in the background when you do something as simple as right-clicking on a file in explorer. Or, try launching IE. RegMon will go crazy!

    As far as using the tools to troubleshoot, I usually logon a system as the restricted user and then do a RUNAS on both FileMon and RegMon. Then launch the application and watch the logs fill up in both utilities. As soon as you run into an error, stop logging in both utilities and review the logs.

    A couple of tips for using them:

    1. Before you even try your application, make sure you filter out all the system processes.(winlogon*;rtvscan*;lsass*;svchost*;ccmexec*, etc)

    2. A lot of problems are due to Access Denied errors. Turn on highlights for the word “denied” and the problems will be easier to find.

    Posted Aug 11 2005, 11:11 AM by Anonymous with no comments
    Filed under:
  • Backup up your AD Infrastructure - Part 3 - WINS

    Here's a script you can use to backup your WINS environment.
  • Backup up your AD Infrastructure - Part 2 - DHCP

    Here's the next article for backing up your infrastructure services - DHCP.
  • Backup up your AD Infrastructure - Part 1 - DNS

    I threw together a few scripts for my current client to do some basic backups/exports for infrastructure services like DNS, DHCP, WINS, Print Services, and Group Policies. Here's an article on the first one - DNS.

  • Finding the perfect MP3 player

    I've been agonizing over which MP3 player to buy for quite sometime. I really want to get one with a built-in compact flash slot because I'd like to have something that I can dump pics from my digi camera to. Or, some of them function as a USB Host so you can do direct transfers over USB.

    I've been considering one of these from Archos for a while but I haven't pulled the trigger yet. AV420  AV700

    Now I see that Creative has released the Zen Vision. And apparently iRiver now has one that you can hook your digital camera directly up to (PMP-140)

    So now I have even more players to consider. Anyone have a MP3 player that they are especially happy with?

    Posted Aug 09 2005, 11:57 AM by Anonymous with no comments
    Filed under:
  • Finding unconfigured sites/subnets in Active Directory

    Here's a script that I wrote for my current client that parses the Netlogon.logs on every DC to determine if any clients have logged onto AD that weren't able to determine their Site. This usually happens because a new department gets migrated or the network team changes/adds subnets on us. Since Sites are so important for logons and DFS, we wanted a way to be alerted whenever this was happening.

  • Keeping the Outlook icon off of the desktop

    We needed to remove the Outlook shortcut from the desktop at my current client because they use Lotus Notes. Unfortunately the Outlook shortcut isn't a normal icon, it is a “namespace link” stored in the registry. Deleting the registry entry is easy enough but we ran into problems because the registry key kept coming back every time a new user logged onto a system.

    This article details the process we used to try to keep that dang shortcut off of the desktop.

  • Using SMS to gather NAV pattern file information

    I threw together an article detailing how you can use a fairly simple vbs script to create a MIF file that will let you use SMS to gather inventory information on your NAV clients. This one just inventories pattern file information and the NAV server that the client is reporting to but it should show you how you can expand the script to gather more info if you need to.

  • Clean up your vbs code with functions and subroutines

    Ok, I've been going through a bunch of vbs scripts that a previous consultant at my current client wrote. Most of the scripts actually work fairly well but trying to follow what they are doing can be difficult and they can be a real pain to update. Some of the cleanup has been fairly complicated but there are a few simple things that I've done that make the code a lot more flexible and a lot easier to understand. Hopefully I'll be able to leave my client with some scripts that they can support themselves when I am gone.

    Here's an example of how a simple subroutine/function can make things easier:

    Old Code Fragment: (basically just adding attributes to a user account)

         objUser.Put "userPrincipalName", strUserName & "@ds.ad.ssmhc.com"
         objUser.SetInfo
         If err.number <> 0 Then
          strRet = err.number
          Call ExceptionHandler("Error in LDAP set info userPrincipalName" & err.number & " Desc: " & err.Description)
         End If
               
         objUser.Put "title", strJobTitle 
         If err.number <> 0 Then
          strRet = err.number
          Call ExceptionHandler("Error in LDAP set info userPrincipalName" & err.number & " Desc: " & err.Description)
         End If
         objUser.SetInfo
         If err.number <> 0 Then
          strRet = err.number
          Call ExceptionHandler("Error in LDAP set info userPrincipalName" & err.number & " Desc: " & err.Description)
         End If
                
         objUser.Put "givenName", strFirstName 
         If err.number <> 0 Then
          strRet = err.number
          Call ExceptionHandler("Error in LDAP put givenName" & err.number & " Desc: " & err.Description)
         End If

    etc.....There were a number of other attributes getting set in the code (100+ lines of code required)

     

    By creating a function that allows you to pass the attribute you are updating and the value you want to set it to you will have code that is easy to update and much easier to understand

    New Code Fragment:

    Call SetAccountAttribute(objUser, "userPrincipalName", strUserName & "@ds.ad.ssmhc.com")
    Call SetAccountAttribute(objUser, "title", strJobTitle)
    Call SetAccountAttribute(objUser, "givenName", strFirstName)
    Call SetAccountAttribute(objUser, "initials", strMiddleInitial)

    Function SetAccountAttribute(objUser, strAttributeName, strAttributeValue)

        objUser.Put strAttributeName, strAttributeValue
        objUser.SetInfo
        If err.number <> 0 Then
            strRet = err.number
            Call ExceptionHandler("Error in LDAP set info: " & strAttributeName & vbTab & _
            vbTab & err.number & " Desc: " & err.Description)
        End If

    End Function

    In this case I could've used a subroutine instead of a function since I am not actually returning any values but I'll probably add that functionality in at some point down the road. By having all of the “smarts“  in a function I have one place that I can make changes instead of the 15 that I would've had before. Plus, the number of lines required dropped from over 100 to less than 20.

     

  • Never, ever trust Brian Tucker

    Ok ok, it didn't take me long to learn one valuable lesson on blogging. Never, ever put the picture of yourself that you link to for your blog on someone else's web site. Brian Tucker seems to think that grabbing pictures from www.uglypeople.com and replacing the stellar picture of myself that I am linking to on his website is the funniest thing in the history of the entire universe. I think he really needs to get out more.

    So please join me in my boycott of the BlogCast Repository. At least until I find another website to post my pic on...

     

    Posted Aug 04 2005, 02:18 PM by Anonymous with no comments
    Filed under:
  • Welcome to my blog

    So I've been sharing an office with a couple of other bloggers on myITforum (Tim Mintner and Brian Tucker) and I decided that I should probably start posting little tips 'n tricks that I run into every once in a while.

    Hopefully I can pull myself away from the very addictive flash game Curveball that seems to be taking up way too much of my time and put some good info out here. Lately I've been cleaning up some old vbs scripts that were written by a previous consultant at my current client. I have some good examples of ways to use functions to cut down the number of lines of code required and also to make the scripts a LOT easier to understand.

    Posted Aug 04 2005, 01:45 PM by Anonymous with no comments
    Filed under:
Copyright - www.myITforum.com, Inc. - 2010 All Rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems