Using Subnet-Directed Broadcasts in SCCM WOL
Written by Shane Ramey   
Monday, 22 August 2011 18:53

Here's a method to add a menu within the SCCM Console and remote-wake (WOL) computers on non-local subnets using subnet-directed broadcasts and mc-wol.exe.

 

1) Download and install the SCCM Console Extensions (google it; the download link may change with new versions) and mc-wol.exe (http://www.matcode.com/wol.htm). Put mc-wol.exe in C:\Program Files (x86)\SCCMConsoleExtensions\

2) Edit C:\Program Files (x86)\SCCMConsoleExtensions\SCCMAction.vbs, in the Wake On LAN section, to use the mc-wol.exe program you downloaded. This code gets a list of interfaces, and sends a WOL packet to the broadcast address of each interface calculated by its IP address and Netmask.

Be sure to allow subnet-directed broadcasts on your routers. I thank the original author of the console extensions for his/her original code. I added some variables and changed how others are calculated.

'============
' Wake On LAN
'============
Sub WakeOnLAN
On Error Resume Next

Set objSMSWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strSiteServer & "\" & strNameSpace)
Set result = objSMSWMIService.ExecQuery("SELECT * FROM SMS_G_System_NETWORK_ADAPTER_CONFIGURATION WHERE ResourceID='" & strResourceID & "' AND IPAddress IS NOT NULL")
For Each instance in result
strMACAddress = instance.MACAddress
strIPAddress = instance.IPAddress
strIPSubnet = instance.IPSubnet
ipAddressBytes = ""
subnetMaskBytes = ""

ipAddressBytes = Split(strIPAddress, ".")
subnetMaskBytes = Split(strIPSubnet, ".")
broadcastAddress = (ipAddressBytes(0) Or (subnetMaskBytes(0) Xor 255)) & "." & (ipAddressBytes(1) Or (subnetMaskBytes(1) Xor 255)) & "." & (ipAddressBytes(2) Or (subnetMaskBytes(2) Xor 255)) & "." & (ipAddressBytes(3) Or (subnetMaskBytes(3) Xor 255))
strCmdLine = "\\server\SMS_AA1\bin\i386\mc-wol.exe " & strMACAddress & " /a " & broadcastAddress
WshShell.Run strCmdLine,True
MsgBox("Ran " & strCmdLine)
Next

WScript.Quit
End Sub

 

Last Updated on Tuesday, 07 February 2012 20:16
 
show_temp.pl on Pacer site instead of PDF
Written by Shane Ramey   
Thursday, 14 July 2011 08:45

A lot of people are not using Adobe-brand  PDF software on their Windows computers. Without the proper pre-configuration their software may not open PDFs unless they have a ".pdf" extension. I was using Nuance PDF Converter Professional to access the Pacer court web site and every time I would try to download the file I would have to rename the show_temp.pl file to show_temp.pdf before I could get it to open. I discovered that the Pacer web site using a Perl (.pl) script to serve the file, but the script does not redirect to a new URL with a .pdf extension but rather serves the data up on the fly with the MIME type set to "application/pdf". For some reason the installation of PDF Converter that I was using did not set this MIME type upon installation.

 

The path in the registry to set the application/pdf MIME type is HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/pdf. I had to create the "application/pdf" subkey, add a string named "Extension" and set its value to ".pdf". Below is the reg file to do this automatically. Hope this helps someone; comment below if you need assistance.

 

Registry file

 

 

Last Updated on Tuesday, 07 February 2012 21:15
 
ntop 4.0.3 noDnsResolution instead of DnsResolutionForAll
Written by Shane Ramey   
Tuesday, 21 December 2010 19:53

After installing ntop 4.0.3 I noticed that I could not get the hostnames to show in the hosts table. This was despite not having specified the -n or the -g flags. After lots of searching, I found that disabling IPv6 would change the run-time configuration to DnsResolution for all. I didn't see any other articles on the Internet about this so I wrote this to hopefully save you some time.

Last Updated on Tuesday, 07 February 2012 20:17
 
Computing IP Broadcast Address with VBScript
Written by Shane Ramey   
Friday, 27 August 2010 19:44

Here's a simple script to calculate the broadcast address of a network using its IP address and subnet mask (VBScript)


subnetMaskBytes
= Split("255.255.255.0", ".")
ipAddressBytes = Split("10.1.122.100", ".")

broadcastAddress = (ipAddressBytes(0) Or (subnetMaskBytes(0) Xor 255)) & "." & (ipAddressBytes(1) Or (subnetMaskBytes(1) Xor 255)) & "." & (ipAddressBytes(2) Or (subnetMaskBytes(2) Xor 255)) & "." & (ipAddressBytes(3) Or (subnetMaskBytes(3) Xor 255))

Last Updated on Tuesday, 07 February 2012 21:03
 
Getting 802.1Q VLANs to work with VMWare
Written by Shane Ramey   
Tuesday, 13 April 2010 18:29

Here's how to create multiple VLANs on a Linux machine running on a VMWare server. I did this to run arpwatch to monitor IP conflicts on our LAN. Be sure not to send any traffic out these interfaces unless you intend it to broadcast to all attached NICs.

 

In VMWare:
1) Click on the server root node, and choose the Configuration tab
2) Select the properties for the NIC that you want to use VLAN tagging on
3) Select Edit to enable Promiscuous Mode

Then in Linux:

4)

# First bring up interface
ip link set eth1 up
# Add VLAN tagged interfaces
ip link add link eth1 name vlan6 type vlan id 6
ip link set vlan6 up
ip link add link eth1 name vlan22 type vlan id 22
ip link set vlan22 up
ip link add link eth1 name vlan23 type vlan id 23
ip link set vlan23 up

If you have any questions, post in the comments below.

Last Updated on Tuesday, 07 February 2012 20:24
 
«StartPrev12NextEnd»

Page 1 of 2