The other day I was contacted by a Cpt Miller with the Connecticut Army National Guard (CTARNG). It turns out that the entire CTARNG uses the program I wrote called Active Directory UserMod Assistant. Cpt Miller needed some modifications made to make it work in his environment. I was able to help him out with his mods. It was a bit odd getting a request like that in Iraq. He didn’t know I was here but it was nice knowing that the program I wrote is helping out the Military.
The tricky part was coding without Active Directory and without any of my reference materials. The changes he was looking for were fairly trivial. I was just excited to do some actual work on a computer besides another roster in excel.
Tags:
AD UserMod Assistant,
adumass,
Technology
2 Comments »
I’ve been having a strange issue with a PCMCIA card on my wife’s computer. Every time the machine is rebooted, you are required to “Scan for Hardware Changes” in device manager. It does not automatically detect that the PCMCIA card is still plugged in. After searching google high and low for a solution, I thought about seeing if I could write a script that would automatically run a hardware scan at logon. Here is what I came up with:
- Download DevCon.exe from Microsoft: DevCon.exe
- Extract either the 32-bit or 64-bit executable to C:\Windows\System32\
- Create a file called: “devcon_rescan.cmd”
- Put the following text in it:
@echo off
devcon.exe /rescan
- Copy the file to C:\Windows\System32\
- Open the registry editor: Start –> Run –> regedit
- Go To: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
- Create a new string value called: DevCon
- Right click the new value and select Modify. Type in the path to the batch file you made (i.e. “C:\WINDOWS\SYSTEM32\devcon_scan.cmd”)
Hope this helps somebody.
Tags:
Scripting,
Technology
No Comments »
I finally got around to the latest version of adumass. This was a major release as it fixed some pretty serious bugs and also greatly improved the UI and backend code. I also added a few functions for data validation. Thanks to all those that have helped and submitted support requests. The next version should have a translation pack for those users that don’t habla englais.
Tags:
AD UserMod Assistant,
adumass,
Technology,
vbscript
No Comments »
So, I am constantly looking for ways of automating tasks. Too many admins do not take advantage of scripting and scheduled tasks/cron. Just this last week, I was implementing a new print server. Besides just building up the new server, I wanted to actually offer the users something new and useful.
I’ve been wanting to setup a network pdf printer for quite some time. I have played around with setting up a network PDF printer using cups. However, we seem to be so MS centric these days that I decided to use PDFCreator’s print server. It was really a piece of cake. Just install the server portion, setup the service, create a share and watch the PDF’s spool.
I quickly found that the folder where PDF’s were written to, was quickly filling with PDF’s as users were not removing them. So, the solution was to write a little vbscript to purge any files older than an hour. There were two things I wanted:
- I have a file named “!FILES ARE PURGED AFTER ONE HOUR!”. I did not want this file removed. It serves as a warning for uses.
- I did not want to purge the folder every hour. I wanted to remove any files that were one hour old or greater. That way, if a user creates a PDF at 2:59pm, the 3:00pm run won’t delete it. It will be deleted on or after 3:59pm.
Here is the script I came up with:
[vb]
strFolder = “C:\Folder\”
Set objShell = CreateObject(”Shell.Application”)
Set objFolder = objShell.Namespace(strFolder)
Set objFSO = CreateObject(”Scripting.FileSystemObject”)
For Each strFileName in objFolder.Items
If len(objFSO.GetExtensionName(strFileName)) > 0 Then
Set objFile = objFSO.GetFile(strFolder & strFileName.Name)
If DateDiff(”N”,objFile.DateLastModified,Now()) > 59 Then
objFSO.DeleteFile(strFolder & strFileName.Name),True
End If
End If
Next[/vb]
The great thing about this is that you get a free network PDF printer that can be left alone. Your boss thinks you are a genius and there is no sweat on your brow.
Cheers!
Tags:
pdfcreator,
vbscript
3 Comments »