tag:blogger.com,1999:blog-53148194779839327322024-03-06T00:14:47.537-08:00Sean Bradleys Tech Blog"We can fix this, but you're gonna need a butter knife, a roll of duct tape, and a car battery."Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.comBlogger49125tag:blogger.com,1999:blog-5314819477983932732.post-41295161704792071362021-01-07T21:59:00.001-08:002021-01-07T21:59:54.944-08:00Retrieving Google Place Data via REST Query to Google API<div style="text-align: left;"><span style="font-family: arial;">So my organisation had a need to get accurate latitude and longitude for all of its facilities and had determined that we didn't have a set of accurate records for this.</span></div><div style="text-align: left;"><span style="font-family: arial;"><br /></span><span style="font-family: arial;">I determined that we could query Google for this using a web request in the format:</span></div><p style="text-align: left;"><br /><span style="font-family: courier; font-size: x-small;">https://maps.googleapis.com/maps/api/place/details/json?placeid=PutYourPlaceIDHere&key=PutYourAPIKeyHere</span></p><div style="text-align: left;"><span style="font-family: arial;">So, having a list of all of the Google Place IDs for the organisations Google My Business setup, I wrote a little script to invoke a JSON call to Google and pull the latitude and longitude for each facility.</span></div><div style="text-align: left;"><span style="font-family: arial;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier; font-size: x-small;"><#<br /># AUTHOR : Sean Bradley<br /># CREATED : 08-01-2021<br /># UPDATED : <br /># COMMENT : Uses Google Maps API Key to grab GMB Data from Web.<br />#<span style="white-space: pre;"> </span>Updates: <br />#<span style="white-space: pre;"> </span>1. <br />#><br />#Establish Logging<br />$RootPath = "C:\Scripts"<br />$Logfile = "$RootPath\GetGMBData.Log"<br />Start-Transcript -path $Logfile<br />#Establish variables<br />Write-Host "Setting some variables" -ForegroundColor Green<br />$InputFile = "$RootPath\GMBPlaceIDs.csv"<br />$OutputFile = "$RootPath\GMBData.csv"<br />$MapsKey = "PutYourAPIKeyHere"<br />$MapsURL = "https://maps.googleapis.com/maps/api/place/details/json?placeid="<br />Write-Host "Doing some preparatory file checks" -ForegroundColor Gray<br />$FileExists = Test-Path -Path $OutputFile -PathType leaf<br />If ($FileExists) {<br /><span style="white-space: pre;"> </span>Write-Host "Deleting last export" -ForegroundColor Gray<br /><span style="white-space: pre;"> </span>Remove-item $OutputFile -force | Out-Null<br /><span style="white-space: pre;"> </span>}<br /># Get Input Data from CSV File <br />$FileExists = Test-Path -Path $InputFile -PathType Leaf<br />if ($FileExists) {<br /><span style="white-space: pre;"> </span>Write-Host "Loading $InputFile for processing." <br /><span style="white-space: pre;"> </span>$tblData = import-csv $InputFile <br /><span style="white-space: pre;"> </span>}<br />else {<br /> Write-Host "$InputFile not found. Stopping script." <br /> exit <br /><span style="white-space: pre;"> </span>}<br /># Query Google for the required JSON Data<br />foreach ($row in $tblData)<br />{ <br /> Write-Host "Getting Google Data for " $row.'Centre' " with Google Place ID " $row.'PlaceId'<br /><span style="white-space: pre;"> <br /></span><span style="white-space: pre;"> </span>$QueryURL = $MapsURL + $row.'PlaceId' + '&key=' + $MapsKey<br /><span style="white-space: pre;"> <br /></span><span style="white-space: pre;"> </span>$Webdata = Invoke-RestMethod $QueryURL -Method Get |<br /><span style="white-space: pre;"> </span>Select-Object @{Label = "Centre";Expression = {$row.'Centre'}}, <br /><span style="white-space: pre;"> </span>@{Label = "PlaceID";Expression = {$row.'PlaceId'}},<br /><span style="white-space: pre;"> </span>@{Label = "Lat";Expression = {$_.result.geometry.location.lat}},<br /><span style="white-space: pre;"> </span>@{Label = "Lng";Expression = {$_.result.geometry.location.lng}}|<br /><span style="white-space: pre;"> </span>#Export to CSV<br /> Export-Csv -Path $OutputFile -NoTypeInformation -Append<br />}<br />Stop-Transcript | out-null</span></div><p style="text-align: left;"></p>Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-82307365581967743422016-10-31T21:32:00.002-07:002016-10-31T21:33:46.597-07:00How to Stop Windows 10 Domain Computers reporting "Disable apps to help improve performance"Create or modify a Group Policy Object that applies to the target computers.<br />
<br />
Under Computer Configuration\Policies\Windows Settings\Scripts\Startup create a Powershell Script entry named "DisableStartupAppTask.ps1"<br />
<br />
In the script, have the single line of code:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">Disable-ScheduledTask -TaskName '\Microsoft\Windows\Application Experience\StartupAppTask'</span><br />
<br />
<br />
<br />Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-3666300438019926502015-06-03T15:47:00.000-07:002016-10-31T21:34:54.075-07:00sFlow: Sampling ratesFrom <a href="http://blog.sflow.com/2009/06/sampling-rates.html?spref=bl">http://blog.sflow.com/2009/06/sampling-rates.html</a>:<br />
<br />
<br />
<br />
<h3 class="post-title entry-title" style="background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 22px; font-stretch: normal; margin: 0px; position: relative;">
<a href="http://blog.sflow.com/2009/06/sampling-rates.html" style="color: #444444; font-stretch: normal; text-decoration: none;">Sampling rates</a></h3>
<div class="post-header" style="background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;">
<div class="post-header-line-1">
</div>
</div>
<div class="post-body entry-content" style="background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px; position: relative; width: 656px;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY05M3zqAuIlFkh00597xJVlsxlU_6FBy5GG8EK_jrsYYqoPJAufDP23pVhdRFe6qXbz0Ow0nUTGwVqiYsYp5Td4_C0O6mYmkUVGONueBZvxZmvbnDN-WW7v9nqfBuwMXa3wdLcaPy3_Iz/s1600-h/samplingrates.PNG" style="color: #3778cd;"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5351720345305216162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY05M3zqAuIlFkh00597xJVlsxlU_6FBy5GG8EK_jrsYYqoPJAufDP23pVhdRFe6qXbz0Ow0nUTGwVqiYsYp5Td4_C0O6mYmkUVGONueBZvxZmvbnDN-WW7v9nqfBuwMXa3wdLcaPy3_Iz/s400/samplingrates.PNG" style="-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; cursor: pointer; display: block; height: 102px; margin: 0px auto 10px; padding: 8px; position: relative; text-align: center; width: 400px;" /></a><br />
A previous posting discussed the <a href="http://blog.sflow.com/2009/05/scalability-and-accuracy-of-packet.html" style="color: #4d469c; text-decoration: none;">scalability and accuracy of packet sampling</a> and the advantages of packet sampling for <span style="text-decoration: underline;"></span><a href="http://blog.sflow.com/2009/05/network-wide-visibility.html" style="color: #4d469c; text-decoration: none;">network-wide visibility</a>.<br />
<br />
Selecting a suitable packet sampling rate is an important part of configuring sFlow on a switch. The table gives suggested values that should work well for general traffic monitoring in most networks. However, if traffic levels are unusually high the sampling rate may be decreased (e.g. use 1 in 5000 instead of 1 in 2000 for 10Gb/s links).<br />
<br />
Configure sFlow monitoring on all interfaces on the switch for full visibility. Packet sampling is implemented in hardware so all the interfaces can be monitored with very little overhead.<br />
<br />
Finally, select a suitable counter polling interval so that <a href="http://blog.sflow.com/2009/05/link-utilization.html" style="color: #4d469c; text-decoration: none;">link utilizations</a> can be accurately tracked. Generally the polling interval should be set to export counters at least twice as often as the data will be reported (see <a href="http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem" style="color: #4d469c; text-decoration: none;">Nyquist-Shannon sampling theory</a> for an explanation). For example, to trend utilization with minute granularity, select a polling interval of between 20 and 30 seconds. Don't be concerned about setting relatively short polling intervals; counter polling with sFlow is very efficient, allowing more frequent polling with less overhead than is possible with SNMP.</div>
Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-27943301885377190092015-03-01T21:16:00.001-08:002023-10-22T20:39:59.492-07:00How to Convert a PFX (PKCS#12) SSL Certificate to Separate KEY and CRT Files<br />
I've had to look this up a number of times, so I'm posting it here for posterity.<br />
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
source:
http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out
[keyfile-encrypted.key]`<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
What this command does is extract the private key from the .pfx file.
Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect
your keypair when you created your .pfx file.
If you cannot remember it anymore you can just throw your .pfx file
away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL
requests you to type in another password, twice!. This new password will
protect your .key file.<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Now let’s extract the certificate:<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out
[certificate.crt]`<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Just press enter and your certificate appears.<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Now as I mentioned in the intro of this article you sometimes need to
have an unencrypted .key file to import on some devices. I probably don’t need to mention that you
should be careful. If you store your unencrypted keypair somewhere on an
unsafe location anyone can have a go with it and impersonate for instance a
website or a person of your company. So
always be extra careful when it comes to private keys! Just throw the
unencrypted keyfile away when you’re done with it, saving just the encrypted
one.<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
The command:<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
`openssl rsa -in [keyfile-encrypted.key] -out [keyfile-decrypted.key]`<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Notes:<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
- When you first extract the key, apply a new password (probably the
same as you used to extract it) and then create an unencrypted key with the rsa
command above<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
- Use an encrypted key file for NGINX otherwise it'll ask for the
password every time it is restarted.<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
- Check the top of the extract .crt file for extra bits above the
----BEING... line and remove if necessary<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
- This certificated needs to be concatenated with the full chain of
certificate authorities `cat domain.crt CA_bundle.crt > final.crt`<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
- test the cert with `openssl s_client -showcerts -connect
www.domain.com:443`<o:p></o:p></div>
<br />
<b>Addendum:</b><br />
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
To convert a PFX file to a PEM files:<br />
<br />
<div class="MsoNormal">
`openssl pkcs12 -in [yourfile.pfx] -out [certificate.pem] -clcerts<o:p></o:p>`</div>
<br />
<div class="MsoNormal">
`openssl pkcs12 -in [yourfile.pfx] -out [cacerts.pem] -cacerts<o:p></o:p>`</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
To convert a PFX file to a combined PEM file in one step AND remove encryption:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
'openssl pkcs12 -in [yourfile.pfx] -out [decrypted.pem] -nodes'<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
</div>
<br />Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-58965012550091649792014-11-25T21:55:00.001-08:002014-11-27T17:19:12.595-08:00Enforce Google Safe SearchSo Google is no longer going to permit the nossl DNS trick that previously allowed organisations to disable SSL for searches so that Safe Search could be enforced.<br />
<br />
<a href="http://googleonlinesecurity.blogspot.com.au/2014/10/an-update-to-safesearch-options-for.html">Google Online Security Blog: An update to SafeSearch options for network administrators</a>
<br />
<br />
The option that they are now permitting is a DNS trick to point users to forcesafesearch.google.com which will still be SSL enabled, but will not allow the user to disable Safe Search.<br />
<br />
The only way to ensure this for all Google search engines is to create a DNS zone for each of Googles search domains.... all 193 or so.<br />
<br />
Microsoft doesn't let you create a CNAME entry for the parent zone, but it does allow you to create a DNAME entry, so I came up with this script to create all of the zones.<br />
<br />
The script, the google.txt file and some basic instructions can be found <a href="http://bit.ly/1xZMeA8" rel="nofollow" target="_blank">here</a>.<br />
<br />
(I added the length check because the original text file had some carriage returns at the end.)<br />
<br />
As always, no responsibility is accepted for its use.<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjp-BMYpvBAHRJFJDJRCt2jblnpK18Dw3lno7bvnfmPGtJzG4u_X0aDIYCH4SY6ZWQODeFQt9Okha6l5qauNh4O5Tsy7tVJUy86NpnWxYjB0Z54UsWT3qQccmtPOXKm33Ig8gspeo6maFa/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> param([string]$inputfile="google.txt")
#Check for the Input file
$FileCheck = Test-Path $inputfile
if ($FileCheck -eq "True")
{
write-output "Input file located"
}
else
{
write-output "Please supply file containing google zone list"
exit
}
#Process each line in the Input file and create a zone and DNAME record
foreach ($zone in Get-Content $inputfile)
{
$count=$count+1
$len = $zone.length -as [int]
if ($len -gt 5)
{
$zone="www"+$zone
write-output "Processing entry $($count). Creating zone for $($zone)"
dnscmd /zoneadd $zone /dsprimary
write-output "Processing entry $($count).Creating DNAME entry for $($zone)"
dnscmd /recordadd $zone "@" DNAME forcesafesearch.google.com
}
else
{
write-output "Zone data for entry $($count) too short. Not processing."
}
}
</code></pre>
Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com2tag:blogger.com,1999:blog-5314819477983932732.post-33728413812827800752014-11-25T21:24:00.001-08:002014-11-25T21:51:55.380-08:00Resize User Photos and Import them into Active Directory Accounts<br />
Resize User Photos and Import them into Active Directory Accounts using PowerShell and ImageMagick.<br />
<br />
This script looks in a specified path for photos named with the EmployeeID attribute of the users in a specified OU, resizes the images to the correct size and then writes the images into the thubnailPhoto attribute of the users Active Directory account.<br />
<br />
As always, no responsibility is accepted for it's use.<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjp-BMYpvBAHRJFJDJRCt2jblnpK18Dw3lno7bvnfmPGtJzG4u_X0aDIYCH4SY6ZWQODeFQt9Okha6l5qauNh4O5Tsy7tVJUy86NpnWxYjB0Z54UsWT3qQccmtPOXKm33Ig8gspeo6maFa/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> param([string]$searchbase , [string]$imagepath)
#Import the ActiveDirectory PowerShell module
import-module ActiveDirectory
#Check for Mandatory Parameters
if (!$searchbase)
{
write-output 'Usage: ADImages {searchbase} {imagepath}'
write-output 'eg. ADImages "OU=Staff,OU=Users,DC=orgname,DC=com,DC=au" \\fileserver\Userimages'
exit
}
if (!$imagepath)
{
write-output 'Usage: ADImages {searchbase} {imagepath}'
write-output 'eg. ADImages "OU=Staff,OU=Users,DC=orgname,DC=com,DC=au" \\fileserver\Userimages'
exit
}
#Check if the Searchbase exists
$OUCheck = [adsi]::Exists("LDAP://$($searchbase)")
if ($OUCheck -eq "True")
{
write-output "Found Searchbase $($searchbase)"
}
else
{
write-output "Searchbase $($searchbase) not found"
exit
}
#Check that the Image Path exists
$ImageCheck = Test-Path $imagepath
if ($ImageCheck -eq "True")
{
write-output "Found Image Path $($imagepath)"
}
else
{
write-output "Image Path $($imagepath) not found"
exit
}
#Check for the ImageMagick Conversion Tool
$ToolCheck = Test-Path ".\ImageMagick\convert.exe"
if ($ToolCheck -eq "True")
{
write-output "ImageMagick tool found"
}
else
{
write-output "ImageMagick tool not found. Download from http://www.imagemagick.org/"
exit
}
#Create the Thumbnail directory if it doesn't exist
$DirCheck = Test-Path ".\ADThumbs"
if ($DirCheck -eq "True")
{
write-output "Thumbnail directory already exists"
}
else
{
write-output "Creating Thumbnail directory"
New-Item -ItemType directory -Path .\ADThumbs
}
#Get an array of users from the Searchbase
$UserList = Get-ADUser -Filter * -SearchBase $searchbase
Foreach ($User in $UserList)
{
#Get the EmployeeID Attribute
$EmpID = Get-ADUser -Filter * -SearchBase $User -Properties employeeID | select -expand employeeID
write-host "Looking for Employee Photo for User $($User) with ID $($EmpID)"
#Tests to see if the UserImages file exists
$FileCheck = Test-Path "$($imagepath)\$($EmpID).jpg"
if ($FileCheck -eq "True")
{
#Retrieves JPG files of the target user from the UserImages share
$jpgfile = "$($imagepath)\$($EmpID).jpg"
$newjpgfileName = ".\ADThumbs\$($EmpID)-AD.jpg"
write-output "Scaling $($jpgfile) to $($newjpgfileName)"
.\ImageMagick\convert $jpgfile -thumbnail 96 -gravity center -crop 96x96+0-15 +repage -strip $newjpgfileName
#Write the thumbnail photo back to the AD user Account
$photo = [byte[]](Get-Content $newjpgfileName -Encoding byte)
Set-ADUser $User -Replace @{thumbnailPhoto=$photo}
}
else
{
#User Image file not found
write-output "Employee ID $($EmpID) not found in $($imagepath)"
}
}
</code></pre>
Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-71665057875199296572014-02-10T15:54:00.000-08:002014-02-10T15:54:41.428-08:00File Path manipulation in ExcelSaw this over at stackoverflow. Had to make a note of it for future reference.<br />
<br />
<a href="http://stackoverflow.com/questions/18617349/excel-last-character-string-match-in-a-string">http://stackoverflow.com/questions/18617349/excel-last-character-string-match-in-a-string</a><br />
<br />
<br />
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Let's say for example you want the right-most \ in the following string (which is stored in cell A1):</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Drive:\Folder\SubFolder\Filename.ext</div>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
To get the position of the last \, you would use this formula:</div>
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;">=FIND("@",SUBSTITUTE(A1,"\","@",(LEN(A1)-LEN(SUBSTITUTE(A1,"\","")))/LEN("\")))
</code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
That tells us the right-most \ is at character 24. It does this by looking for "@" and substituting the very last "\" with an "@". It determines the last one by using</div>
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;">(len(string)-len(substitute(string, substring, "")))\len(substring)
</code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
In this scenario, the substring is simply "\" which has a length of 1, so you could leave off the division at the end and just use:</div>
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;">=FIND("@",SUBSTITUTE(A1,"\","@",LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))))
</code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Now we can use that to get the folder path:</div>
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;">=LEFT(A1,FIND("@",SUBSTITUTE(A1,"\","@",LEN(A1)-LEN(SUBSTITUTE(A1,"\","")))))
</code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
Here's the folder path without the trailing \</div>
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;">=LEFT(A1,FIND("@",SUBSTITUTE(A1,"\","@",LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))))-1)
</code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
And to get just the filename:</div>
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;">=MID(A1,FIND("@",SUBSTITUTE(A1,"\","@",LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))))+1,99)
</code></pre>
<div style="background-color: white; border: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;">
However, here is an alternate version of getting everything to the right of the last instance of a specific character. So using our same example, this would also return the file name:</div>
<pre style="background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;">=TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",99)),99))</code></pre>
Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-42434426423343465412013-05-19T23:14:00.000-07:002013-05-19T23:19:09.761-07:00Memory Leak in Windows 8 Network Data Usage Monitoring Driver<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">Just thought I'd share this experience I had over the weekend, as it may save someone else many hours of troubleshooting.</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">I've been tinkering around with Windows 8 at home, even though I know there's little likelihood that we'll implement it at work any time soon.</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">While using my Windows 8 machine to copy a large amount of files from my NAS to a USB drive, I was experiencing lock-ups of my system. It wasn't a complete crash. The system would just become extremely unresponsive.</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">It soon became apparent that something was leaking memory. I was seeing the amount of memory being consumed skyrocket up to 100%, at which point the copy process would crash and system would stop responding politely. The task manager and performance monitor were not attributing the memory to any process however.</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">I tried using robocopy instead of Explorer copy. Same thing.</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">I tried updating the Realtek network driver, USB 3 driver and even the ASUS BIOS, (as they were all a few versions behind). Same thing.</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">I was getting to the point where I was figuratively scratching my head, so I tried booting into safe mode with networking. Aha! The memory usage stayed consistent and the copy performed just fine!</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">There are a number of network related drivers that safe mode don't load. </span><span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"><a href="http://www.nirsoft.net/utils/driverview.html" target="_blank">DriverView</a> showed that one of them is the Windows Network Data Usage Monitoring Driver <a href="http://batcmd.com/windows/8/services/ndu/" target="_blank">ndu.sys</a> that was introduced in Windows 8 and provides</span><span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"> "network data usage monitoring functionality"</span><span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">.</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">Disabling this driver by changing the start value to 4 in HKLM\SYSTEM\CurrentControlSet\Services\Ndu </span><br />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">solved the problem.</span><br />
<br style="color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;" />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">Maybe this will be fixed when Microsoft releases Blue.</span><br />
<span style="background-color: white; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"><br /></span>Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com2tag:blogger.com,1999:blog-5314819477983932732.post-70261267299300592012-12-03T15:09:00.002-08:002013-05-19T23:21:04.372-07:00Using ICACLS to Grant Permissions on FoldersIt took me a little while to work this out because I found the documentation <a href="http://technet.microsoft.com/en-us/library/cc753525(v=ws.10).aspx" target="_blank">here</a> a little confusing and multiple interpretations of it seem to be floating around the net.<br />
<br />
My goal was to grant a group permissions to access a folder, modify the subfolders and files within it, but not have the ability to modify the folder itself in any way. A pretty common requirement right? You would think some administrator somewhere would have come up with a clear set of instructions on how to do it, but I couldn't find any definitive answer that did quite what I wanted. Eventually, I figured out what I was doing wrong and scripted it myself.<br />
<br />
So, the answer is:<br />
<br />
<span style="color: #990000; font-family: Courier New, Courier, monospace;">icacls "Folder Path" /grant:r "AuthenticationRealm\GroupOrUser":(OI)(CI)(IO)(D,RC,S,AS,GR,GW,GE,RD,WD,AD,REA,WEA,X,DC,RA)</span><br />
<span style="color: #990000; font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: #990000; font-family: Courier New, Courier, monospace;">icacls "Folder Path" /grant "AuthenticationRealm\GroupOrUser":(RC,S,AS,GR,GE,RD,WD,AD,REA,X,DC,RA)</span><br />
<div>
<br /></div>
<div>
The first command <i>replaces </i>[<span style="color: #990000; font-family: Courier New, Courier, monospace;">/grant:r</span>] any existing permissions for the <span style="color: #990000; font-family: Courier New, Courier, monospace;">GroupOrUser</span> on all <i>Subfolders and files only</i> of the <span style="color: #990000; font-family: Courier New, Courier, monospace;">Folder Path</span> and all of it's contents that inherit [<span style="color: #990000; font-family: Courier New, Courier, monospace;">(OI)(CI)(IO)</span>] without forcing inheritance, and grants everything except Change permissions and Take ownership rights.</div>
<div>
<br /></div>
<div>
The second command grants <span style="color: #990000; font-family: Courier New, Courier, monospace;">GroupOrUser</span> permissions to the <span style="color: #990000; font-family: 'Courier New', Courier, monospace;">Folder Path</span> itself, but grants only those permissions that allow the <span style="color: #990000; font-family: Courier New, Courier, monospace;">GroupOrUser</span> to be able to create files/folders and write data. They are not able to delete or modify the folder.</div>
<div>
<br /></div>
<div>
The permissions list in the first command can be modified to give Read Only access or Write Only (Dropbox) style access. If you're doing dropbox style access, it's sometimes a good idea to give the special identity CREATOR OWNER extra permissions so that submitters can modify their own work and it can also be a good idea to use <a href="http://technet.microsoft.com/en-us/library/cc784710(v=ws.10).aspx" target="_blank">Access-based Enumeration</a> so that submitters cannot <i>see </i>other users submissions that may be in the same share.</div>
<div>
<br /></div>
<div>
There's probably a better way to do this in Powershell, but I haven't discovered it yet.</div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-91168709786964863852011-10-17T22:34:00.000-07:002011-11-17T18:09:47.255-08:00Enumerating Indirect Group MembershipsA colleague asked me yesterday if I knew how to get a list of all direct AND indirect group memberships that a user had. He wanted to use this to estimate the Kerberos token size for users with large numbers of group memberships as this can cause access problems if it exceeds set limits.<br />
<br />
I vaguely remembered that I had something like this in a script I wrote to enumerate the members of a group both directly and indirectly. It uses the functionality of the Remote Server Administration Tools. There's also a <a href="http://support.microsoft.com/kb/980254">hotfix</a> to correct the output. I dug out the script and revised it to provide what he required.<br />
<br />
In its simplest form, the command to run is:<br />
<br />
<br />
<div class="MsoNormal">
dsget user <fulldn> -memberof -expand<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
For example:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
dsget user "CN=testuser,OU=Staff,DC=company,DC=com"
-memberof -expand<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
This will provide a list of group memberships in fulldn format. To simplify it to SAM group names you can pipe the output to another dsget command for the groups:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
dsget user <fulldn> -memberof -expand | dsget group -samid</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
You can also simplify the input if you pipe in the dsquery command for the user:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
dsquery user -samid <samid> | dsget user -memberof -expand | dsget group -samid</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
For example:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
dsquery user -samid testuser | dsget user -memberof -expand | dsget group -samid </div>
<div class="MsoNormal">
<br />
<br /></div>
<div class="MsoNormal">
<blockquote class="tr_bq">
<span class="Apple-style-span" style="background-color: white; color: #444444;">Edit: You can use the same technique to list the members of a group:<br />dsquery group -samid <Groupname> | dsget group -members | dsget user -samid -fn -ln</span></blockquote>
<blockquote class="tr_bq">
<span class="Apple-style-span" style="background-color: white; color: #444444;">Also, be wary of pasting one of these command strings in Outlook, as it has the tendency to automatically change hyphens to the longer "dash", which is an invalid character if you copy it out of Outlook and paste it to the command prompt.</span></blockquote>
<br /></div>Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-24846002108302796752011-09-19T16:06:00.000-07:002011-09-19T16:09:01.285-07:00DNS Suffix Search Order via DHCPI was recently working on a new parallel domain with one of the members of my team and the issue of DNS Suffix Search Order came up. The search order had to be set to include the parallel domain, the primary domain and a number of other things.<br />
<br />
I was adamant that the search order could be set by DHCP as well as by GPO, but I couldn't specifically remember the details. My engineer pointed me to this <a href="http://support.microsoft.com/kb/275553">Microsoft Knowledge Base article</a> that states:<br />
<blockquote>
<span class="Apple-style-span" style="background-color: white; font-family: 'Segoe UI', Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;">The following methods of distribution are not available for pushing the domain suffix search list to DNS clients:</span><br />
<ul style="position: inherit;"><span class="Apple-style-span" style="background-color: white; font-family: 'Segoe UI', Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;">
<li style="position: inherit;">Dynamic Host Configuration Protocol (DHCP). You cannot configure DHCP to send out a domain suffix search list. This is currently not supported by the Microsoft DHCP server.</li>
</span></ul>
<span class="Apple-style-span" style="background-color: white; font-family: 'Segoe UI', Arial, Verdana, Tahoma, sans-serif; font-size: 11px; line-height: 16px;">
</span></blockquote>
Fortunately, an engineer from another department came to the rescue with DHCP Option 135. This can be added in Windows Server 2008 as follows (I believe this originated in a TechNet post):<br />
<br />
<span class="Apple-style-span" style="background-color: #f5f5ff; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">1. On the 2008 Server running DHCP, open the DHCP MMC.<br />2. Expand DHCP and choose the DHCP server name.<br />3. Right click on IPv4<br />4. Choose "Set Predefined Options"<br />5. Click on Add.<br />6. Name: "Domain suffix search order"<br />Data Type: String<br />Code: "135" (without the quotation marks)<br />Description: "List of domain suffixes in order" (without the quotation marks)<br />String: enter your search suffixes separated by comma with no spaces</span><br />
<span class="Apple-style-span" style="background-color: #f5f5ff; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;">sample1.com.au,sample2.net,sample3.org</span><br />
<span class="Apple-style-span" style="background-color: #f5f5ff; font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13px;"><br />7. Click onto the OK to save changes .<br />8. Exit the DHCP MMC and restart the DHCP Server Service.<br />9. Open the DHCP MMC again and now scope option 135 is a listed option.</span><br />
<br />
<br />
<br />
<br />
<br />Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com2tag:blogger.com,1999:blog-5314819477983932732.post-91968888381588621502011-03-21T17:39:00.000-07:002011-03-24T02:17:18.792-07:00Reverse DNSI recently had a guy ask me how he could fix a corrupt reverse DNS.<br />
<br />
Simple enough, I thought and proceeded to instruct him how to change the AD Integrated DNS zone to a "Standard Primary" DNS zone, then take the DNS file, import it into Excel and manipulate the data however he wanted. He could then just put the file back and reload the DNS zone and that's that.<br />
<br />
I also told him how he could use DNSCMD to export the DNS data from an AD Integrated zone.:<br />
<span class="pBody postableBody"><b>dnscmd /ZoneExport FQDN_of_zonename Zone_export_file</b></span><br />
<br />
<span class="pBody postableBody">He </span>then started telling me he had problems locating the reverse DNS information and it was at this point my techie sense started tingling. He may not even have a reverse DNS zone (it is completely optional, but can be quite useful), or may actually be referring to his DNS resolver cache. (I haven't determined the answer yet).<br />
<br />
Reverse DNS operates just like regular DNS, but instead of looking up an IP address using a hostname, you look up the hostname from the IP address. This can be very useful in easily determining which host is the source or destination of traffic, instead of finding the port on the local switch.<br />
<br />
Reverse DNS zones use the network address in reverse notation and the suffix in-addr.arpa. So if your network's IP Schema is based on subnets of the private range 172.16.0.0, you could have a reverse DNS zone of 16.172.in-addr.arpa, which could contain entries for all hosts within all subnets on your network. Of course, if you have an extremely large network, you probably want to break this down further, such as 10.16.172.in-addr.arpa, etc.<br />
<br />
So, if your host server.company.com has an (A) record of 172.16.10.99, he can have a pointer DNS record type (PTR) in the reverse DNS zone of 99.10.16.172.in-addr.arpa pointing back to its designated hostname of server.company.com.<br />
<br />
Reverse DNS zones for IPv6 use the special zone ip6.arpa and store their loooong IPv6 addresses as a sequence of nibbles in reverse order in much the same way as the IPv4 addresses are stored in reverse order. So an IPv6 address of 2001:0db8:85a3::62cd will be stored as a PTR record as d.c.2.6.0.0.0.0.3.a.5.8.8.b.d.0.1.0.0.2.ip6.arpa.<br />
<br />
A DNS resolver cache on a caching name server will resolve a query, even though they are not authoritative for the result, by making a query to the authoritative server on behalf of the client. The caching name server will then store this record for it's Time-To-Live (TTL) in a local cache. This will result in quicker resolutions and reduced load on Internet name servers. A corrupted resolver cache can simply be cleared and it will rebuild itself with use.Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-41177490595198929602011-02-23T22:10:00.000-08:002011-02-23T22:10:25.601-08:00Importing Autocomplete File into Outlook 2010This is something I answered over at Experts Exchange and thought I'd post here as well.<br />
<br />
The .NK2 file used by Outlook 2003 and Outlook 2007 and is used to suggest addresses when you start typing in the recipients field is no longer used by Outlook 2010.<br />
<br />
This file can be imported by Outlook 2010 and the contacts placed in the "Suggested Contacts" folder in the mailbox.<br />
<br />
<span class="pBody postableBody">Copy the .NK2 file to the "C:\Users\%username%\AppDa<wbr></wbr>ta\Roaming<wbr></wbr>\Microsoft<wbr></wbr>\Outlook" folder (assuming the client is Windows 7)<br />
<br />
Rename the nk2-file to the name of your mail profile:</span><br />
<div class="indent"><span class="pBody postableBody"> </span>In the Control Panel, type "mail" into the search box.<br />
<span class="pBody postableBody"> </span>Run the Mail applet.<br />
<span class="pBody postableBody"> </span>Click on the Show Profiles… button.<br />
<span class="pBody postableBody"> </span>By default, your profile is called “Outlook”. So in that case you would call your file “outlook.nk2”.</div><br />
Start Outlook with the /importnk2 switch:<br />
<div class="indent"> outlook.exe /importnk2</div><br />
Outlook will import the NK2 data into the Suggested Contacts folder.Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-5769665563682387362010-12-16T15:23:00.000-08:002011-03-21T21:08:49.516-07:00Wake on LAN over the InternetI was recently sitting at a desk at work with one of my colleagues and needed some information on my home computer. He watched as I turned on my home computer, established a remote session into it, got the information I needed and then shut it down again (I don't believe in leaving the computer turned on and wasting power).<br />
<br />
"So that was interesting," said my colleague. "How did you set that up?"<br />
<br />
The first thing to know about waking up your computer over the Internet is that not all home firewall/routers are going to be able to do it. Check the specs of your device. Along with the usual things like port forwarding, it needs to support static ARP entries. If it can, it's relatively straightforward.<br />
<br />
First of all, set a static IP address on your target machine. Then go into the properties of the network card and enable Wake on LAN if it is not already enabled (It's usually enabled by default). You may have to enable Wake on LAN in the BIOS as well. Record the MAC address of your machine as you will need this to wake it (you can get this at the command prompt with an <i>ipconfig /all</i> ). <br />
<br />
Next, you need to register the static IP address of your machine in the ARP table of your router. This is the part that some firewall/router devices targeting the home market are not going to be able to do. You will need to refer to your devices manual or support site to determine how to do this. You may not be able to do this while the network interface you are registering is connected to the network, so you may require another network interface or a second computer.<br />
<br />
Finally, you need to set up a virtual server on your firewall with the following parameters:<br />
<ul><li>Use the UDP protocol.</li>
<li>Use 9 for the internal port.</li>
<li>Use your static IP address of the target computer for the internal address. </li>
<li>Use any common port for the external port, but choose one not already in use. If you don't have a POP3 Mail server for instance, you could use 110. </li>
</ul><br />
I would also advise that you set up a Dynamic DNS. Many home firewall/router devices will be able to register their address automatically with one of these sites (for example: <a href="http://www.dyndns.com/">http://www.dyndns.com</a> or <a href="http://www.no-ip.com/">http://www.no-ip.com</a>.) This enables you to just remember a FQDN entry instead of an IP address and will also update if your IP address changes.<br />
<br />
Now you should be able to turn off your computer and use another computer, or even a smart phone to send a magic packet to wake up the computer. I use <a href="http://www.depicus.com/wake-on-lan/woli.aspx">http://www.depicus.com/wake-on-lan/woli.aspx</a><br />
<br />
Just enter the MAC address of the computer, the IP address or FQDN, 255.255.255.255 as the subnet mask (as you are targeting a single host) and the port number you registered as the external port for your virtual server. Click the WAKE ON LAN button and your computer should turn itself on moments later!<br />
<br />
If you have another virtual server set up to relay VNC or RDP to your machine, you can then control the machine remotely. <br />
<br />
<br />
Cheers,<br />
SeanSean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-50750897993745491912010-11-11T15:20:00.000-08:002010-11-11T15:20:20.880-08:00iPhone emails missing message bodyThere's any number of blogs and forum posts on the web that probably already have this, but I discovered an issue with the way the iPhone email handles interaction with PDFs and iBooks today.<br />
<br />
If you download and email onto iphone with an attached PDF and save that PDF to iBooks the email body in all messages will disappear.<br />
<br />
<br />
The simple solution is to reboot the phone or kill the mail process.<br />
<br />
I expect Apple will patch this soon.Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-43088423200976496032010-09-30T16:26:00.000-07:002010-09-30T16:27:31.948-07:00Reset Passwords for all User Accounts in an OUI realise that there's plenty of scripts floating around the net that already do this, but for me this was simply an exercise.<br />
<br />
Note: I haven't gotten around to testing it yet.<br />
<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' PasswordReset.vbs</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' Resets all passwords within an AD Container</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' Version 1.0</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' 27 September 2010</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">Option Explicit</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">Dim objRootDSE, objOU, objUser</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">Dim strTargetOU, strForceReset, strEnAcct, strDNSDomain, strNewPass</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">Dim intCounter, intUACval, intPWLval</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' Change strTargetOU to location of user accounts</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">strTargetOU = "MyContainer"</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' Change strNewPass to the new password</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">strNewPass = "Password123"</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' Change strForceReset to "Yes" in order to force users to reset passwords</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">strForceReset = "No"</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' Change strEnAcct to "Yes" in order to enable disabled accounts</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">strEnAcct = "No"</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' Int Values </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' See Microsoft KB305144 for UserAccountControl values</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">' Setting PwdLastSet value to 0 forces password reset</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">intUACval = 544</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">intPWLval = 0</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">intCounter = 0</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">Set objRootDSE = GetObject("LDAP://RootDSE") </span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">strDNSDomain = objRootDSE.Get("DefaultNamingContext")</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">strTargetOU = "OU=" & strTargetOU & ", " & strDNSDomain</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">set objOU =GetObject("LDAP://" & strTargetOU )</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">For each objUser in objOU</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">If objUser.class="user" then</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">objUser.SetPassword strNewPass</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">objUser.SetInfo</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">If strForceReset="Yes"</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">objUser.Put "pwdLastSet", intPWLval</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">objUser.SetInfo</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">End if</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">If strEnAcct="Yes"</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">objUser.Put "userAccountControl", intUACval</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">objUser.SetInfo</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">End if</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">intCounter = intCounter +1</span></span><br />
<span class="Apple-tab-span" style="white-space: pre;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> </span></span></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">End if</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">Next</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"><br />
</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;">WScript.Echo "New Password: " & strNewPass & vbCr & "Accounts changed: " & intCounter _</span></span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="color: #660000;"> & vbCr & "Password Change Forced: " & strForceReset & vbCr & "Disabled Accounts Enabled: " & strEnAcct</span></span><br />
<span class="Apple-style-span" style="color: #660000;"> </span><br />
<br />
<div><br />
</div>Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-72361208869284490482010-09-07T01:16:00.000-07:002010-09-09T02:05:05.436-07:00SCCM: Excluding a directory structure from being inventoried.A colleague asked me today how to exclude a directory structure on a single client machine from being inventoried by SCCM. The answer is to create a hidden sparse text file named skpswi.dat in the folder.<br />
<br />
Thanks Tyriax for the question!Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-9814093299546416852010-09-01T16:16:00.000-07:002010-09-01T16:16:33.109-07:00Office Autosave LocationsI always thought that the autosave for an Office file was created in the same location as the file. It turns out that this was because I almost always work with Office files on network drives.<br />
<br />
When a new file is started a temporary file is created. This can be either in the windows temp directory, in "C:\ Documents and Settings\<username>\Application Data\Microsoft". If the file is stored on a network drive then it will be temporarily created there.<br />
<br />
This temporary file will have a few different letters after the tilde (or squiggly line “ ~”) . These are good ones to look for to find some lost info. There are others, but these are the ones most likely to contain data that can be recovered.Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-73800520758555382682010-08-12T21:16:00.000-07:002010-08-26T23:00:19.518-07:00Subroutine to quit a VBS login script on Windows 2003/2008 serversSub DetectOS()<br /><br />strComputer = "."<br />Set objWMIService = GetObject("winmgmts:" _<br /> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")<br /><br />Set colOperatingSystems = objWMIService.ExecQuery _<br /> ("Select * from Win32_OperatingSystem")<br /><br /> For Each objOperatingSystem In colOperatingSystems<br /> If InStr( objOperatingSystem.Caption,"2003") <> 0 _<br /> or InStr( objOperatingSystem.Caption,"2008") <> 0 Then<br /> WriteLog "Detected Operating System: " & objOperatingSystem.Caption<br /> WriteLog "Script will not continue...."<br /> WScript.Quit(0)<br /> Else<br /> WriteLog "Detected Operating System: " & objOperatingSystem.Caption<br /> WriteLog "Script will continue....."<br /> End if<br /> NextEnd SubSean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-28885178186900618842010-07-04T21:39:00.000-07:002010-08-26T23:00:19.533-07:00Exchange and Server NamingI worked for an organisation once that had a naming convention for its servers that constituted:<br /><ul><li>a country code (2 alpha)</li><li>a location code (3 alpha)</li><li>a server type code (2 alpha)</li><li>an instance number (2 numeric)</li></ul>This was fine as naming conventions go (although these days I personally prefer location independent naming conventions as modern servers can so easily and quickly be relocated).<br /><br />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.<br /><br />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.<br /><br />So take care not to name your mail servers with a name that starts with a valid SMTP command!<br /><br />Cheers,<br />SeanSean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-76104038351095490272010-07-04T20:03:00.000-07:002010-08-26T23:00:19.570-07:00Locating Encrypted FilesWhen 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.<br /><br />I located this handy script that will identify encrypted files in a volume (just change the drive letter as necessary):<br /><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;">strComputer = "."</span><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;">Set objWMIService = GetObject("winmgmts:" _</span><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;"> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")</span><br /><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;">Set colFolders = objWMIService. _</span><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;"> ExecQuery("Select * from Win32_Directory where Drive='C:'" _</span><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;"> & " AND Encrypted=True")</span><br /><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;">For Each objFolder in colFolders</span><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;"> Wscript.Echo "Name: " & objFolder.Name</span><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;"> Wscript.Echo "Path: " & objFolder.Path</span><br /><span style="color: #660000; font-family: "Courier New",Courier,monospace;">Next </span>Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-21645825064790330472010-06-16T23:54:00.000-07:002010-09-07T17:44:16.629-07:00Excel: Splitting Names<div style="font-family: Arial,Helvetica,sans-serif;">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:</div><div style="font-family: Arial,Helvetica,sans-serif;"><br />
</div><div style="font-family: Arial,Helvetica,sans-serif;">Assuming data is in A1 and the value of the cell is "Charles Kingsford Smith"</div><div style="font-family: Arial,Helvetica,sans-serif;"><br />
</div><div style="font-family: Arial,Helvetica,sans-serif;">For First Name use:</div><div style="font-family: Arial,Helvetica,sans-serif;"></div><div style="color: #660000; font-family: Arial,Helvetica,sans-serif;">=LEFT(A1,FIND(" ",A:A)-1) </div><div style="font-family: Arial,Helvetica,sans-serif;"></div><div style="font-family: Arial,Helvetica,sans-serif;">for a resulting value of "Charles"</div><div style="font-family: Arial,Helvetica,sans-serif;"><br />
<br />
</div><div style="font-family: Arial,Helvetica,sans-serif;">and for Last Name use:</div><div style="font-family: Arial,Helvetica,sans-serif;"></div><div style="color: #660000; font-family: Arial,Helvetica,sans-serif;">=MID(A1,FIND(" ",A1)+1,LEN(A1))</div><div style="font-family: Arial,Helvetica,sans-serif;"></div><div style="font-family: Arial,Helvetica,sans-serif;">for a resulting value of "Kingsford Smith"<br />
<br />
</div>Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0tag:blogger.com,1999:blog-5314819477983932732.post-50064694230684652772010-05-13T22:36:00.000-07:002010-08-26T23:00:19.593-07:00Change the READY message on HP Printers<div style="font-family: Arial,Helvetica,sans-serif;"><div style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code>A little bit of Friday humour...<b> </b></code></span><br /><br /><span style="font-size: small;"><code><b>Be aware that this may be against your organisations Acceptable Use Policy</b>. Also be aware that people without a sense of humour may not find it funny. <i><b>Don't get into trouble!</b></i></code></span></div><div style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code><br /></code></span></div><div style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code>The message may be reset to the default by power cycling the printer, or re-running the script and passing "READY" as the message.</code></span></div><div style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><br /></span></div><div style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code>Please note, I have not tested this... yet... hehehe. </code></span></div><br /><br /><span style="font-size: small;"><code>Telnet to port 9100 on the printer and enter the following: </code></span></div><br /><div style="color: #444444; font-family: "Courier New",Courier,monospace;"><span style="font-size: small;"><code>\e%-12345X\@PJL JOB<br />\@PJL RDYMSG DISPLAY="MESSAGE HERE"<br />\@PJL EOJ<br />\e%-12345X</code></span></div><br /><div style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: small;"><code>Some funny suggestions:</code></span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Insert Coin”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Insert Cheese”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Im Sad..”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Low Monkeys”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Feed me a cat”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Insert Butter & Jam”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Free The Ink!!”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“My Cousin Is A Toaster”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Load Soy Latte”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Paper Tastes Funny Today”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Free Hugs..”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Toner Tastes Funny Today”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Press OK Button for Pacman”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Flower Power Mode”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Incoming Fax…”,</span></div><div style="color: #660000; font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">“Cheese Mode”</span></div><code><br /></code><br /><br /><code><br /></code>Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com3tag:blogger.com,1999:blog-5314819477983932732.post-21091380623727397772010-02-23T21:06:00.000-08:002016-10-31T21:41:43.214-07:00WCCP - Traffic Flow Diagram<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: "arial" , "helvetica" , sans-serif;">I couldn't find a good <em><strong>generic</strong></em> WCCP traffic flow diagram, so I created one:</span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div align="left" class="separator" style="clear: both; text-align: center;">
<br /></div>
<div align="left" class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5ZbXaz2awEZfYt8aGKQHDMhwWBT1OmYP1wTKnOghuZ0TStDG7D8-6WW2qGH1WIKpsZXRpG1jVzNhR_pN6plasP-d8CoGppj6S9KfbQc4JooseZtiI-s60lmlf1gDyWQNFSCkAdZ5/s1600-h/Security+-+Web+Cache+Communication+Protocol.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="449" kt="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja5ZbXaz2awEZfYt8aGKQHDMhwWBT1OmYP1wTKnOghuZ0TStDG7D8-6WW2qGH1WIKpsZXRpG1jVzNhR_pN6plasP-d8CoGppj6S9KfbQc4JooseZtiI-s60lmlf1gDyWQNFSCkAdZ5/s640/Security+-+Web+Cache+Communication+Protocol.png" width="640" /></a></div>
Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com1tag:blogger.com,1999:blog-5314819477983932732.post-13023846167855000332010-02-11T21:19:00.000-08:002010-08-26T23:00:19.611-07:00SCCM: Failed in GetCertificate(...): 0x80040281<span style="font-family: Arial, Helvetica, sans-serif;">I started seeing this error in the ccmsetup.log file on some client machines after updating to Service Pack 2 on the SCCM Server:</span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br /><span style="color: #444444; font-family: "Courier New", Courier, monospace;">Failed in GetCertificate(...): 0x80040281</span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br /><span style="font-family: Arial, Helvetica, sans-serif;">The SP2 installation does not automatically update the client installation files. In the SCCM console, if you navigate to:</span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br /><span style="color: #660000; font-family: Arial, Helvetica, sans-serif;">Site Database : Site Management : Site Code - Site Name: Site Settings : Client Installation Methods</span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br /><span style="font-family: Arial, Helvetica, sans-serif;">...and open <span style="color: #660000;">Software Update Point Client Installation</span>, 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.</span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br /><span style="font-family: Arial, Helvetica, sans-serif;">You may also need to update the client in other locations, such as Group Policy or the Right-Click tools.</span><br /><br /><span style="font-family: Arial;">Cheers,</span><br /><span style="font-family: Arial;">Sean</span>Sean Bradleyhttp://www.blogger.com/profile/14296472892737688674noreply@blogger.com0