Sub DetectOS()
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem In colOperatingSystems
If InStr( objOperatingSystem.Caption,"2003") <> 0 _
or InStr( objOperatingSystem.Caption,"2008") <> 0 Then
WriteLog "Detected Operating System: " & objOperatingSystem.Caption
WriteLog "Script will not continue...."
WScript.Quit(0)
Else
WriteLog "Detected Operating System: " & objOperatingSystem.Caption
WriteLog "Script will continue....."
End if
NextEnd Sub
Thursday, August 12, 2010
Sunday, July 4, 2010
Exchange and Server Naming
I worked for an organisation once that had a naming convention for its servers that constituted:
Unfortunately, this resulted in a server name of AUTHOMS01. You might look at this and think "Okay, no problem" and you would be right, unless you installed Exchange on the server.
We couldn't for the life of us figure out why Exchange would not complete SMTP transactions even though the answer was staring us in the face. It turned out that whenever the server communicated with a destination server, the transaction stopped whenever the AUTHOMS01 server presented itself.... because SMTP saw the first four letters of the server name as a valid SMTP command: AUTH.
So take care not to name your mail servers with a name that starts with a valid SMTP command!
Cheers,
Sean
- a country code (2 alpha)
- a location code (3 alpha)
- a server type code (2 alpha)
- an instance number (2 numeric)
Unfortunately, this resulted in a server name of AUTHOMS01. You might look at this and think "Okay, no problem" and you would be right, unless you installed Exchange on the server.
We couldn't for the life of us figure out why Exchange would not complete SMTP transactions even though the answer was staring us in the face. It turned out that whenever the server communicated with a destination server, the transaction stopped whenever the AUTHOMS01 server presented itself.... because SMTP saw the first four letters of the server name as a valid SMTP command: AUTH.
So take care not to name your mail servers with a name that starts with a valid SMTP command!
Cheers,
Sean
Locating Encrypted Files
When undertaking a file migration project between Active Directory domains and forests, it's necessary to locate any EFS encrypted files in order to decrypt them prior to the decommissioning of the old domain and the loss of the keys.
I located this handy script that will identify encrypted files in a volume (just change the drive letter as necessary):
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService. _
ExecQuery("Select * from Win32_Directory where Drive='C:'" _
& " AND Encrypted=True")
For Each objFolder in colFolders
Wscript.Echo "Name: " & objFolder.Name
Wscript.Echo "Path: " & objFolder.Path
Next
I located this handy script that will identify encrypted files in a volume (just change the drive letter as necessary):
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders = objWMIService. _
ExecQuery("Select * from Win32_Directory where Drive='C:'" _
& " AND Encrypted=True")
For Each objFolder in colFolders
Wscript.Echo "Name: " & objFolder.Name
Wscript.Echo "Path: " & objFolder.Path
Next
Wednesday, June 16, 2010
Excel: Splitting Names
I've been working on a project that requires the manipulation of name data. A lot of the names were given as full names, some with multiple last names, that for the purposes of data manipulation had to be split. Here's the simple way to do it:
Assuming data is in A1 and the value of the cell is "Charles Kingsford Smith"
For First Name use:
=LEFT(A1,FIND(" ",A:A)-1)
for a resulting value of "Charles"
and for Last Name use:
=MID(A1,FIND(" ",A1)+1,LEN(A1))
for a resulting value of "Kingsford Smith"
Thursday, May 13, 2010
Change the READY message on HP Printers
A little bit of Friday humour...
Be aware that this may be against your organisations Acceptable Use Policy. Also be aware that people without a sense of humour may not find it funny. Don't get into trouble!
The message may be reset to the default by power cycling the printer, or re-running the script and passing "READY" as the message.
Please note, I have not tested this... yet... hehehe.
Telnet to port 9100 on the printer and enter the following:
\e%-12345X\@PJL JOB
\@PJL RDYMSG DISPLAY="MESSAGE HERE"
\@PJL EOJ
\e%-12345X
Some funny suggestions:
“Insert Coin”,
“Insert Cheese”,
“Im Sad..”,
“Low Monkeys”,
“Feed me a cat”,
“Insert Butter & Jam”,
“Free The Ink!!”,
“My Cousin Is A Toaster”,
“Load Soy Latte”,
“Paper Tastes Funny Today”,
“Free Hugs..”,
“Toner Tastes Funny Today”,
“Press OK Button for Pacman”,
“Flower Power Mode”,
“Incoming Fax…”,
“Cheese Mode”
Tuesday, February 23, 2010
Thursday, February 11, 2010
SCCM: Failed in GetCertificate(...): 0x80040281
I started seeing this error in the ccmsetup.log file on some client machines after updating to Service Pack 2 on the SCCM Server:
Failed in GetCertificate(...): 0x80040281
The SP2 installation does not automatically update the client installation files. In the SCCM console, if you navigate to:
Site Database : Site Management : Site Code - Site Name: Site Settings : Client Installation Methods
...and open Software Update Point Client Installation, you should be prompted to update the published version of the client. Note that it can take 30 seconds or so before you can re-open it to see the published version match the available version.
You may also need to update the client in other locations, such as Group Policy or the Right-Click tools.
Cheers,
Sean
Failed in GetCertificate(...): 0x80040281
The SP2 installation does not automatically update the client installation files. In the SCCM console, if you navigate to:
Site Database : Site Management : Site Code - Site Name: Site Settings : Client Installation Methods
...and open Software Update Point Client Installation, you should be prompted to update the published version of the client. Note that it can take 30 seconds or so before you can re-open it to see the published version match the available version.
You may also need to update the client in other locations, such as Group Policy or the Right-Click tools.
Cheers,
Sean
Subscribe to:
Comments (Atom)