Path variables in batch files
This is another post documenting something I used to fix a problem at work so I don’t forget about it. We were pushing out Firefox to all our systems yesterday via SCCM. It’s pushed out using a batch file to configure various things, and I noticed that although the batch file was being called from the dozen or so distribution points we have, the script was calling back to the main server. I’ve seen this before but never looked into a solution. I started searching for a variable or a way to get the path the script is run from and found this article posted in 2008 on myITforum.com. It is addressing the exact situation I was encountering.
Failure when injecting Windows 7 drivers into a SCCM 2007 OSD boot image
This problem was driving me nuts for the last week, and is more for my own memory than anything else. At work we got a demo unit from HP of the desktop computer we’re going to be rolling out this summer and I was updating the network drivers in our OS Deployment boot images. The Windows PE environment wasn’t getting the network drivers installed and finally I saw the error message “The selected driver is not applicable to any supported platforms.”
The fix was easy. Microsoft KB 978754 has a hotfix that needs to be installed on the SCCM Site Server, then the server needs to be rebooted. The drivers then installed without a problem. The KB article says the cause of the issue was the driver importing wizard couldn’t recognize drivers signed for only Windows 7.
Good to know.
PowerShell: Add printers to DNS
I realized today that most of our printers at work did not have DNS entries. This isn’t a big problem for users because they’re on our print server and they get their printers through Group Policy. The Print server has each printer set up to the IPs. We just implemented a management system today, and it lists the printers by IP and because the DNS entries were “Unknown” for most of them, it wasn’t easy to determine what printer we were looking at.
I found several PowerShell examples on the web for interacting with Microsoft DNS servers, and took a bit from each to come up with this script. It takes the shared printer name and publishes that as the DNS name. This does cause a problem if you have spaces in a share name, but our environment doesn’t, so I didn’t program for that issue.
Here’s the script:
blocking IE6
Let’s get this out of the way first…I think that IE6 is a horrible browser.
Now that that’s done, the sad truth is that many of us have to deal with IE6 on a daily basis. The school district I work for still has one quarter of the computers running Windows 2000. They have been updating the hardware, but for political reasons were unable to update the operating system for a few years. When I started last January they were halfway through a migration to Vista and had skipped XP entirely. However, there is still 1/4 of the district to go so we’re supporting IE6 for another 7 months or so.
Fixing IT problems with a hammer
In a continuing process of cleaning up horrible decisions by our predecessors, we just moved a website off one of our domain controllers. The website was moving from IIS6 to 7 (or 7.5, whatever comes with Server 2008 R2), and it required some tweaking to start working again. One of the parts that didn’t work was a self-help page where teachers could unlock student accounts. I set up this web server, and created a service account for it that doesn’t have any special rights on the domain. Because the website runs in IIS as this service account, it could query the domain with no problems, but it didn’t have the rights to unlock accounts.
This is obviously where I differ from a coworker…
him: “Just add the service account to Domain Admins”
me: “Why would I want to do that?”
In the end I remembered I can delegate just the permissions needed to unlock our student accounts to that service account and it works fine.
Why use a hammer when you only need a tiny screwdriver?