Wednesday 22 May 2013

IT Management: Red Ocean vs Blue Ocean Strategies

Red oceans represent all the industries in existence today – the known market space. In the red oceans, industry boundaries are defined and accepted, and the competitive rules of the game are known. Here companies try to outperform their rivals to grab a greater share of product or service demand. As the market space gets crowded, prospects for profits and growth are reduced. Products become commodities or niche, and cutthroat competition turns the ocean bloody; hence, the term red oceans.
Blue oceans, in contrast, denote all the industries not in existence today – the unknown market space, untainted by competition. In blue oceans, demand is created rather than fought over. There is ample opportunity for growth that is both profitable and rapid. In blue oceans, competition is irrelevant because the rules of the game are waiting to be set. Blue ocean is an analogy to describe the wider, deeper potential of market space that is not yet explored.
The cornerstone of Blue Ocean Strategy is 'Value Innovation'. A blue ocean is created when a company achieves value innovation that creates value simultaneously for both the buyer and the company. The innovation (in product, service, or delivery) must raise and create value for the market, while simultaneously reducing or eliminating features or services that are less valued by the current or future market.
References:

1.  Blue Ocean Strategy

2.  Red Ocean vs Blue Ocean Strategies

IT Technology: Awesome Data Centers

This is a nifty infographic, courtesy of WhoIsHostingThis?, that offers a little data center trivia: the biggest data centers in the world, statistics on the energy they consume, and facts about the data centers used by some of the Internet’s most popular services like Google and Twitter.




Reference:

Infographic: Awesome data centers
http://www.techrepublic.com/blog/networking/infographic-awesome-data-centers/6602?tag=nl.e019&s_cid=e019&ttag=e019

Tuesday 21 May 2013

Apple: iDevice (iPad) in Education

It's all about verbs, that is, the things teachers can do with an iPad. Those actions include showing your screen on a projector, managing the classroom, assessing student work, interacting with students, accessing your files, making instructional media, and expanding professional learning. The infographic below focuses mostly on free apps that you'll be able to put to use immediately. Those apps turn your iPad in a timer, interactive whiteboard, voice recorder, document camera, calendar, magazine, notebook, and much more.
So take a peek to see how iPad can help you capture learning artifacts, plan lessons, poll students, visualize concepts, share demonstrations, and much more.




Reference:

1.  iPad as the Teacher's Pet
http://learninginhand.com/blog/2013/4/7/ipad-as-the-teachers-pet-infographic

Sunday 19 May 2013

BlueCoat: Video Caching with CacheFlow

The BlueCoat CacheFlow appliance is a high-performance web caching solution designed to help service providers save significantly on bandwidth and accelerate the delivery of rich Web 2.0 content, including video. CacheFlow easily scales to support more users and greater traffic volumes over time, plus provides built-in tools for web traffic reporting and filtering to protect users.
With CacheFlow, you don’t have to keep buying expensive bandwidth to meet performance goals. Using CacheFlow, you can dramatically cut infrastructure costs and deliver a more responsive web experience.
And with the patent-pending CachePulse technology, customers can be confident the CacheFlow solution will sustain high bandwidth savings and user experience gains over the long haul. CachePulse tracks the ever-changing web, so as new sites emerge or popular sites change how they deliver content, new caching rules and instruction updates are automatically delivered from the CachePulse cloud to the CacheFlow appliance.
The two major features of CacheFlow are:
1. Bandwidth Savings = Cost Savings 
CacheFlow helps service providers like you save significantly on expensive bandwidth and backhaul traffic. Designed to easily scale by adding more appliances or building out content-specific cache farms, you can use CacheFlow to accelerate the delivery of rich Web 2.0 content, including video, while easily accommodating more users and greater traffic volumes. Save 40-50% on general web traffic and achieve up to 90% savings with dedicated content caches for significant long-term savings and a short Return on Investment (ROI).
2.  Your Customers' Experience = Increase Web Performance
CacheFlow improves your customers' online experience by boosting web performance by 10x. Improve overall customer satisfaction, reduce support calls and related costs, and gain a competitive edge with faster downloads speeds. Many service providers are finding user experience to be a key competitive differentiator, especially when it comes to delivering rich content like video, plus it provides opportunity to deliver premium, high-speed Internet services.

Tuesday 14 May 2013

IT Technology: Firewall (Hardware Based)

What is a firewall?

Generally, think of firewall as the security standing outside your gate. They inspect everyone that comes in and out, stop unauthorized people from entering a building, maintain a record of all entry and exits and  so on.

A firewall is not so different. It keeps a check of all incoming and outgoing connections of your computer network and based on the rules configured on the firewall, it will allow/deny access to certain computers, or technically speaking IP addresses. 
A few other things it does is it maintains a log of all incoming and outgoing connections along with the date and time stamp, shows what connections were blocked and why, and of course the best part, prevents unknown people from getting into your network from the internet.
But make no mistake. A firewall is the least you can do to secure your network – that’s right. A firewall is the most basic thing to have in place when it comes to securing your computer or an entire network.
There are two types of firewall:
1.  Hardware based firewall
These are physical machines with network ports. Commonly installed at the entry point of your network.  These are used to protect an entire network from internet threats and are generally used  at offices.
2.  Software based firewall
These are commonly associated  with antivirus software. You can download it on your Windows computer and install it yourself.  These are used to protect a single computer from internet threats. Generally used for personal use. Most popular are Norton, McAfee, Kaspersky and Comodo Firewall.

How does a firewall operate?
Before I go on telling you how does a firewall work let me talk about some general concepts of computer networking, one in particular – “IP Address”
Think of IP address similar to your physical mailing address. There is one similarity in particular – its unique. So if you have to send in a letter, you’d go to the nearest post-office, on the letter you’d write your address (source), the recipient’s address (destination) and that’s it.
A computer network operates in a similar way -  every computer or device is assigned a unique IP address using which, communication takes place. This is where a firewall comes in – the administrator would want to control, what computer(s)  should or should not communicate.
So we place a firewall in between two networks to control/monitor/log all IP communication. Most commonly, this is placed between an internal network -  A local area network or LAN
and an external network  – usually WAN or wide area network or most popularly known as the Internet.
So why would we place a firewall between your local network and the internet? That’s right, we would like to shield our internal network from external threats. By placing a firewall right in the middle, we can define certain “rules” that will tell the firewall what communication should be allowed or disallowed. After we have defined certain rules on the firewall – the firewall would check the headers of every packet (a packet is a unit of data in IP networks) and would either allow it to go through or block it. This is basically how the firewall operates.



Hardware based firewall

With so many firewalls available in the market, network administrator tends to get confused. In general, your decision should be made on the following:

1.  Performance requirements

2.  Feature requirements
3.  Cost – one time and recurring costs
4.  Support
5.  Availability of IT Consulting

A golden rule to remember – “Your firewall is only as good as your configuration”
A firewall by itself doesn't do much. It’s the firewall setup and its configuration that decides the fate of your network. So if you spend $2000 on a high-performance firewall, but don’t have the configuration done right, you’re in for a lot of trouble.
A firewall should be configured under the direct supervision of an information security expert. Once you bring in a firewall in your network, you have to make sure the firewall is configured in accordance to your company’s  IT security policy to get the most out of your expense.
Before you make a decision, be sure to have a good IT consultancy firm with security expertise or an independent IT security consultant to help you plan your network security.

References:
2.  Enterprise Network Firewall Magic Quadrant for 2013
http://www.checkpoint.com/products/promo/gartner-firewall/

Monday 13 May 2013

Microsoft: Active Directory (AD) Password Expiry Email Notification and Summary Report

This Powershell script allows you to notify your users that their AD password will expire soon or has expired. Furthermore, as a system administrator, you are going to receive a list of users whose AD password is going to expire soon or has expired.


# Start of script
# Purpose:
# Powershell script to find out a list of users
# whose password is expiring within x number of days (as specified in $days_before_expiry).
# Email notification will be sent to them reminding them that they need to change their password.

#####################
# Variables to change
#####################
# Days to Password Expiry
$days_before_expiry = 14
# SMTP Server to be used
$smtp = "192.168.1.2"
# "From" address of the email
$from = "email@abc.com"
# Administrator email
$admin = "email@abc.com"
# Web address of your OWA url - tested only with Exchange 2007 SP2
$OWAURL = "mail.abc.com"
# First name of administrator
$AdminName = "System Administrator"
# Define font and font size
# ` or \ is an escape character in powershell
$font = "<font size=`"3`" face=`"Calibri`">"

##########################################
# Should require no change below this line
# (Except message body)
##########################################
function Send-Mail{
param($smtpServer,$from,$to,$subject,$body)
$smtp = new-object system.net.mail.smtpClient($SmtpServer)
$mail = new-object System.Net.Mail.MailMessage
$mail.from = $from
$mail.to.add($to)
$mail.subject = $subject
$mail.body = $body
# Send email in HTML format
$mail.IsBodyHtml = $true
$smtp.send($mail)
}
# Newline character
#$newline = [char]13+[char]10
$newline = "<br>"
# Get today's day, date and time
$today = (Get-date)
# Loads the Quest.ActiveRoles.ADManagement snapin required for the script.
# (Will unload once powershell is exited)
# chose either one below
# Add-pssnapin "Quest.ActiveRoles.ADManagement"
# Get-PSSnapin "Quest.ActiveRoles.ADManagement"
add-pssnapin "Quest.ActiveRoles.ADManagement"
Set-QADPSSnapinSettings -DefaultSizeLimit 0

# Retrieves list of users whose account is enabled, has a passwordexpiry date and whose password expiry date within (is less than) today+$days_before_expiry
$users_to_be_notified = Get-QADUser  -SearchRoot "OU=USA,DC=abc,DC=local" -Enabled -passwordNeverExpires:$False | Where {($_.PasswordExpires -lt
$today.AddDays($days_before_expiry))}
# Send email to notify users
foreach ($user in $users_to_be_notified) {
# Calculate the remaining days
# If result is negative, then it means password has already expired.
# If result is positive, then it means password is expiring soon.
$days_remaining = ($user.PasswordExpires - $today).days
        # Set font for HTML message
        $body = $font
        # For users whose password already expired
        if ($days_remaining -le 0) {
                # Make the days remaining positive (because we are reporting it as expired)
                $days_remaining = [math]::abs($days_remaining)
                # Add it in a list (to be sent to admin)
                $expired_users += $user.name + " - <font color=blue>" + $user.LogonName + "</font>'s password has expired <font color=blue>" + $days_remaining + "</font> day(s) ago." + $newline
                # If there is an email attached to profile
                if ($user.Email -ne $null) {
                        # Email notification to user
                        $to = $user.Email
                        $subject = "Reminder - Password has expired " + $days_remaining + " day(s) ago."
                        # Message body is in HTML font
                        $body += "Dear " + $user.givenname + "," + $newline + $newline
                        $body += "This is a friendly reminder that your password for account'<font color=blue>" + $user.LogonName + "</font>' has already expired "+ $days_remaining + " day(s) ago." + $newline + $newline
                        $body += "Please contact email@abc.com ( EXT. 9999 ) to arrange for your password to be reset."
                        }
                else {
                        # Email notification to administrator
                        $to = $admin
                        $subject = "Reminder - " + $user.LogonName+ "'s Password has expired " + $days_remaining + " day(s) ago."
                        # Message body is in HTML font
                        $body += "Dear administrator," + $newline + $newline
                        $body += "<font color=blue>" + $user.LogonName+ "</font>'s password has expired <font color=blue>" + $days_remaining + " day(s) ago</font>."
                        $body += " However, the system has detected that there is no emailaddress attached to the profile."
                        $body += " Therefore, no email notifications has been sent to " + $user.Name + "."
                        $body += " Kindly reset the password and notify user of the password change."
                        $body += " In addition, please add a corresponding email address to the profile so emails can be sent directly for future notifications."
                        }
                # Put a timestamp on the email
                $body += $newline + $newline + $newline + $newline
                $body += "<h5>Message generated on: " + $today + ".</h5>"
                $body += "</font>"
                # Invokes the Send-Mail function to send notification email
# Comment out this line if you do not want to send email to users with already expired passwords.
                Send-Mail -smtpServer $smtp -from $from -to $to -subject $subject -body $body
        }
        # For users whose password is expiring
        # if ($days_remaining -gt 0) {
        else {
                # Add it in a list (to be sent to admin)
                $expiring_users += $user.name + " - <font color=blue>" +$user.LogonName + "</font> has <font color=blue>" + $days_remaining +"</font> day(s) remaing left to change his/her password." + $newline
                # If there is an email attached to profile
                if ($user.Email -ne $null) {
                        # Email notification to user
                        $to = $user.Email
                        $subject = "Reminder - Password is expiring in " + $days_remaining +" day(s)."
                        # Message body is in HTML font
                        $body += "Dear " + $user.givenname + "," + $newline + $newline + $newline
                        $body += "This is a friendly reminder that your AD account password '<font color=blue>" + $user.LogonName + "</font>' is due to expire in "+ $days_remaining + " day(s)." + $newline + $newline + $newline
                        $body += "Please refer to the links below for quick guides" + $newline + $newline
                        $body += "For Windows user:" + $newline
                        $body += "\\fileserver\Public\Change_Windows_Password.pdf" + $newline + $newline
                        $body += "For Mac user:" + $newline
                        $body += "smb://fileserver/Share/Change_Mac_Password.pdf" + $newline + $newline
                        $body += "Please remember to change your password before <fontcolor=blue>" + $user.PasswordExpires.date.tostring('dd/MMM/yyyy') +"</font>."
                        }
                else {
                        # Email notification to administrator
                        $to = $admin
                        $subject = "Reminder - " + $user.LogonName+ "'s Password is expiring in " + $days_remaining + " day(s)."
                        # Message body is in HTML font
                        $body += "Dear administrator," + $newline + $newline
                        $body += "<font color=blue>" + $user.LogonName+ "</font>'s passwordis expiring in <font color=blue>" + $days_remaining + " day(s)</font>."
                        $body += " However, the system has detected that there is no emailaddress attached to the profile."
                        $body += " Therefore, no email notifications has been sent to " +$user.Name + "."
                        $body += " Kindly remind him/her to change the password before <fontcolor=blue>" + $user.PasswordExpires.date.tostring('dd/MMM/yyyy') +"</font>."
                        $body += " In addition, please add a corresponding email address to the profile so emails can be sent directly for future notifications."
                        }
                # Put a timestamp on the email
                $body += $newline + $newline + $newline + $newline
                $body += "<h5>Message generated on: " + $today + ".</h5>"
                $body += "</font>"
                # Invokes the Send-Mail function to send notification email
                Send-Mail -smtpServer $smtp -from $from -to $to -subject $subject -body $body
        }
}
# If there are users with expired password or users whose password is
# expiring soon
if ($expired_users -ne $null -or $expiring_users -ne $null) {
                # Email notification to administrator
                $to = $admin
                $subject = "< Info > Password Expiry Report"
                # Message body is in HTML font        
                $body = $font
                $body += "Dear " + $AdminName + ","+ $newline + $newline
                $body += "The following users' passwords are expiring soon or have already expired." + $newline + $newline + $newline
                $body += "<b>Users with expired passwords:</b>" + $newline
                $body += $expired_users + $newline + $newline
                $body += "<b>Users with passwords expiring soon:</b>" + $newline
                $body += $expiring_users
                # Put a timestamp on the email
                $body += $newline + $newline + $newline + $newline
                $body += "<h5>Message generated on: " + $today + ".</h5>"
                $body += "</font>"
                # Invokes the Send-Mail function to send notification email
                Send-Mail -smtpServer $smtp -from $from -to $to -subject $subject -body $body
}
# End of script 

Friday 10 May 2013

BlueCoat: Web 2.0 and Mobile Applications Control

Web traffic today is diverse. To effectively manage the content that users in your network can access, you can allow or block access to the content using web categories, web applications and web operations.

You can also control access to web content using a URL or domain name. In today’s web milieu, this is not an effective solution because the elements of a web site are served from multiple URLs or domains. Blocking specific URLs is effective only when you know that the content is always served from a specific domain or URL.

To allow reasonable access to Web content, you need to create policy that combines categories, applications and operation controls. This means that you can allow access to certain applications within a category while blocking the category itself, or restrict selected operations across all applications.

The pre-requisites for enabling web and mobile application control at BlueCoat device is as follows:
  •  Proxy Edition license (not a MACH5 license)
  • The Blue Coat WebFilter feature must be enabled. (Configuration > Content Filtering > General)
  • A current BCWF database must be downloaded to the ProxySG. (Configuration > Content Filtering > Blue Coat WebFilter)
  • The ProxySG must have one or more Web services, such as External HTTP and HTTPS, set to intercept. Bypassed Web traffic is not classified into applications.

For the applications you have blocked, you do not have to update your policy to continue blocking the new content sources; To block newly recognized applications, you will need to select the new applications and refresh your network policy.

When you block by operation, unlike blocking by application, you prevent users in your network from performing the specified operation for all applications that support that operation. They can however, access the application itself.


Note, however, that the Request URL operation object only pertains to operations for sites that BCWF recognizes as Web applications. So, blocking picture uploads would not prevent users in your network from using FTP to upload a JPEG file to an FTP server, or from using an HTTP POST to upload a picture on a Web site running bulletin board software.


The following application and operation control objects allow you to match against the URL in an HTTP or HTTPS request that the ProxySG appliance receives from clients in the network and create policy to allow or restrict access to the requested action or content:
1.  Request URL Application
The Request URL Application object gives you the ability to block popular Web applications such as Facebook, Linkedin, or Pandora. As new applications emerge or existing applications evolve, BCWF tracks the domains that these Web applications use to serve content, and provides periodic updates to include the new domains that are added. You can use the Request URL Application object to block an application and all the associated domains automatically.
2.  Request URL Operation
The Request URL Operation object restricts the actions a user can perform on a Web application. For instance, when you select the Upload Picture action for the Request URL Operation, you create a single rule that blocks the action of uploading pictures to any of the applications or services where the action can be performed such as Flickr, Picasa, or Smugmug.


Reference:
1.  How do I control Web 2.0 and Mobile applications in my network?
https://kb.bluecoat.com/index?page=content&id=KB4784&actp=RSS

BlueCoat: Playback Error with Youtube Video on iDevices (iPad or iPhone)


When an iDevice (iPhone or iPad) tries to play a YouTube video through the embedded player, the video does not load when going through a BlueCoat ProxySG. The playback error appears.
This is a known issue with the way that the application tries to request the video by requesting byte-ranges.  The workaround is to disable caching for requests that contain the HTTP header for "Range".  This will have a minimal impact to performance since it only applies to the iDevices.
In order to solve this issue, you can add the following policy entries to the local or visual policy on the ProxySG.
define condition YouTubeRangeRequests    
url.domain="youtube.com"
url.domain="googlevideo.com"
end condition YouTubeRangeRequests  

<Proxy>    
request.header.Range="bytes" condition=YouTubeRangeRequests bypass_cache(yes)


References:
1.  YouTube and Google video will not play on iPhone/iPad/iPod
https://kb.bluecoat.com/index?page=content&id=KB4193&actp=RSS

2.  How do I add CPL to a local policy file on the ProxySG?
https://kb.bluecoat.com/index?page=content&id=KB3495

Thursday 9 May 2013

IT Management: Vendor Management


Vendor management is one of the key skills in IT management. Vendor management comes into the picture because the time, money and energy used to nurture a positive vendor relationship cannot be measured directly against the company's bottom line.  However, a well-managed vendor relationship will result in increased customer satisfaction, reduced costs, better quality, and better service from the vendor.  When and if problems arise, rest assured that a well-managed vendor will be quick to remedy the situation.


Summary:
1.  Business benefits of good vendor management:

  • Lower costs
  • Increased flexibility and simplicity
  • Better vendor communications
  • More productive partnerships
  • Reduced storage requirements
  • Easier renegotiations


2.  Process of vendor management:

          a.       Engage
          b.      Investigate
          c.       Evaluate
          d.      Negotiate
          e.      Contract
          f.        Compliance
          g.       Renew




3.  Strategies to strengthen vendor relations:

  • Share information and priorities
  • Balance commitment and competition
  • Allow key vendors to help you strategize
  • Build partnerships for the long term
  • Seek to understand your vendor's business too
  • Negotiate to a Win-Win agreement
  • Come together on value


4.  Vendor management best practices:

  • Vendor selection
  • Scrutinize the prospects
  • Remain flexible monitor performance
  • Communicate constantly


References:
1.  Business Management Case Study: How Cisco IT Improved Strategic Vendor Management
http://www.cisco.com/web/about/ciscoitatwork/business_of_it/vendor_management.html


Wednesday 8 May 2013

VMware: Thin Provisioning Space Reclamation

Thin provisioning has been a great feature for virtual disk. You get the effect of using more physical resources than are actually available, yet you use less physical storage and spend less money on storage. It’s pretty easy to see the benefits. Often associated with large disk storage systems such as SANs and storage virtualization systems, thin provisioning allows enough space to be easily allocated to servers when that space is needed. 

Over allocation of storage in a thin provisioning environment allows a server to view more storage capacity than has actually been physically reserved for the server. The storage gets used only when needed by an application. This over-allocation is a key benefit of thin provisioning.

But often, data is written on a thin-provisioned drive and then deleted. This can happen at the Windows OS level, rather than at the hardware level. This occurs with thin-provisioned virtual disk drives. And in this situation, there’s a good chance you want that space back. But you typically can’t get the space back — it’s not available to use because the blocks that were previously written need to be zeroed out first. 

Thin provisioning deleted space can be reclaimed with a few different ways, eg. PerfectDisk Zero Fillvmkfstools and SDelete.

References:

2. Thin Provisioning

Tuesday 7 May 2013

Microsoft: Microsoft Exchange Server 2010 Email Traffic Reporting


This Powershell script allows you to easily generate the past one month email traffic report that consists of the following information:

  1. User
  2. Total Sent
  3. Total Sent (MB)
  4. Total Received
  5. Total Received (MB)
  6. Sent Internal
  7. Sent Internal (MB) 
  8. Sent External 
  9. Sent External (MB)
  10. Received Internal 
  11. Received Internal (MB) 
  12. Received External 
  13. Received External (MB) 
  14. Total Sent Unique 
  15. Total Sent Unique (MB)
  16. Sent Internal Unique
  17. Sent Internal Unique (MB) 
  18. Sent External  Unique
  19. Sent External Unique (MB) 

The report is in CSV format and it is stored in C drive.


$today = get-date
$rundate = $($today.adddays(-30)).toshortdatestring()

$outfile_date = ([datetime]$rundate).tostring("yyyy_MM")
$outfile = "Email_traffic_" + $outfile_date + ".csv"

$dl_stat_file = "DL_stats.csv"

$accepted_domains = Get-AcceptedDomain |% {$_.domainname.domain}
[regex]$dom_rgx = "`(?i)(?:" + (($accepted_domains |% {"@" + [regex]::escape($_)}) -join "|") + ")$"

$mbx_servers = Get-ExchangeServer |? {$_.serverrole -match "Mailbox"}|% {$_.fqdn}
[regex]$mbx_rgx = "`(?i)(?:" + (($mbx_servers |% {"@" + [regex]::escape($_)}) -join "|") + ")\>$"

$msgid_rgx = "^\<.+@.+\..+\>$"

$hts = get-exchangeserver |? {$_.serverrole -match "hubtransport"} |% {$_.name}

$exch_addrs = @{}

$msgrec = @{}
$bytesrec = @{}

$msgrec_exch = @{}
$bytesrec_exch = @{}

$msgrec_smtpext = @{}
$bytesrec_smtpext = @{}

$total_msgsent = @{}
$total_bytessent = @{}
$unique_msgsent = @{}
$unique_bytessent = @{}

$total_msgsent_exch = @{}
$total_bytessent_exch = @{}
$unique_msgsent_exch = @{}
$unique_bytessent_exch = @{}

$total_msgsent_smtpext = @{}
$total_bytessent_smtpext = @{}
$unique_msgsent_smtpext=@{}
$unique_bytessent_smtpext = @{}

$dl = @{}


$obj_table = {
@"
User = $($address.split("@")[0])
Total Sent = $(0 + $total_msgsent[$address])
Total Sent (MB) = $("{0:F2}" -f $($total_bytessent[$address]/1mb))
Total Received = $(0 + $msgrec[$address])
Total Received (MB) = $("{0:F2}" -f $($bytesrec[$address]/1mb))
Sent Internal = $(0 + $total_msgsent_exch[$address])
Sent Internal (MB) = $("{0:F2}" -f $($total_bytessent_exch[$address]/1mb))
Sent External = $(0 + $total_msgsent_smtpext[$address])
Sent External (MB) = $("{0:F2}" -f $($total_bytessent_smtpext[$address]/1mb))
Received Internal = $(0 + $msgrec_exch[$address])
Received Internal (MB) = $("{0:F2}" -f $($bytesrec_exch[$address]/1mb))
Received External = $(0 + $msgrec_smtpext[$address])
Received External (MB) = $("{0:F2}" -f $($bytesrec_smtpext[$address]/1mb))
Total Sent Unique = $(0 + $unique_msgsent[$address])
Total Sent Unique (MB) = $("{0:F2}" -f $($unique_bytessent[$address]/1mb))
Sent Internal Unique  = $(0 + $unique_msgsent_exch[$address])
Sent Internal Unique (MB) = $("{0:F2}" -f $($unique_bytessent_exch[$address]/1mb))
Sent External  Unique = $(0 + $unique_msgsent_smtpext[$address])
Sent External Unique (MB) = $("{0:F2}" -f $($unique_bytessent_smtpext[$address]/1mb))
"@
}

$props = $obj_table.ToString().Split("`n")|% {if ($_ -match "(.+)="){$matches[1].trim()}}

$stat_recs = @()

function time_pipeline {
param ($increment  = 1000)
begin{$i=0;$timer = [diagnostics.stopwatch]::startnew()}
process {
    $i++
    if (!($i % $increment)){Write-host “`rProcessed $i in $($timer.elapsed.totalseconds) seconds?-nonewline}
    $_
    }
end {
    write-host “`rProcessed $i log records in $($timer.elapsed.totalseconds) seconds?
    Write-Host "   Average rate: $([int]($i/$timer.elapsed.totalseconds)) log recs/sec."
    }
}

foreach ($ht in $hts){

    Write-Host "`nStarted processing $ht"

    get-messagetrackinglog -Server $ht -Start "$rundate" -End "$today" -resultsize unlimited |
    time_pipeline |%{
   
   
    if ($_.eventid -eq "DELIVER" -and $_.source -eq "STOREDRIVER"){
   
        if ($_.messageid -match $mbx_rgx -and $_.sender -match $dom_rgx) {
           
            $total_msgsent[$_.sender] += $_.recipientcount
            $total_bytessent[$_.sender] += ($_.recipientcount * $_.totalbytes)
            $total_msgsent_exch[$_.sender] += $_.recipientcount
            $total_bytessent_exch[$_.sender] += ($_.totalbytes * $_.recipientcount)
       
            foreach ($rcpt in $_.recipients){
            $exch_addrs[$rcpt] ++
            $msgrec[$rcpt] ++
            $bytesrec[$rcpt] += $_.totalbytes
            $msgrec_exch[$rcpt] ++
            $bytesrec_exch[$rcpt] += $_.totalbytes
            }
           
        }
       
        else {
            if ($_messageid -match $messageid_rgx){
                    foreach ($rcpt in $_.recipients){
                        $msgrec[$rcpt] ++
                        $bytesrec[$rcpt] += $_.totalbytes
                        $msgrec_smtpext[$rcpt] ++
                        $bytesrec_smtpext[$rcpt] += $_.totalbytes
                    }
                }
       
            }
               
    }
   
   
    if ($_.eventid -eq "RECEIVE" -and $_.source -eq "STOREDRIVER"){
        $exch_addrs[$_.sender] ++
        $unique_msgsent[$_.sender] ++
        $unique_bytessent[$_.sender] += $_.totalbytes
       
            if ($_.recipients -match $dom_rgx){
                $unique_msgsent_exch[$_.sender] ++
                $unique_bytessent_exch[$_.sender] += $_.totalbytes
                }

            if ($_.recipients -notmatch $dom_rgx){
                $ext_count = ($_.recipients -notmatch $dom_rgx).count
                $unique_msgsent_smtpext[$_.sender] ++
                $unique_bytessent_smtpext[$_.sender] += $_.totalbytes
                $total_msgsent[$_.sender] += $ext_count
                $total_bytessent[$_.sender] += ($ext_count * $_.totalbytes)
                $total_msgsent_smtpext[$_.sender] += $ext_count
                 $total_bytessent_smtpext[$_.sender] += ($ext_count * $_.totalbytes)
                }
                             
           
        }
       
    if ($_.eventid -eq "expand"){
        $dl[$_.relatedrecipientaddress] ++
        }
    }    
   
}

foreach ($address in $exch_addrs.keys){

$stat_rec = (new-object psobject -property (ConvertFrom-StringData (&$obj_table)))
$stat_recs += $stat_rec | select $props
}

$stat_recs | export-csv C:\$outfile -notype

if (Test-Path $dl_stat_file){
    $DL_stats = Import-Csv $dl_stat_file
    $dl_list = $dl_stats |% {$_.address}
    }
   
else {
    $dl_list = @()
    $DL_stats = @()
    }


$DL_stats |% {
    if ($dl[$_.address]){
        if ([datetime]$_.lastused -le [datetime]$rundate){
            $_.used = [int]$_.used + [int]$dl[$_.address]
            $_.lastused = $rundate
            }
        }
}
   
$dl.keys |% {
    if ($dl_list -notcontains $_){
        $new_rec = "" | select Address,Used,Since,LastUsed
        $new_rec.address = $_
        $new_rec.used = $dl[$_]
        $new_rec.Since = $rundate
        $new_rec.lastused = $rundate
        $dl_stats += @($new_rec)
    }
}

Write-Host "`nRun time was $(((get-date) - $today).totalseconds) seconds."
Write-Host "Email stats file is $outfile" 

Microsoft: Microsoft Exchange Server 2010 Mailbox Reporting


This Powershell script allows you to easily generate the latest Exchange report that consists of the following information:
  1. Display Name
  2. Database
  3. Issue Warning Quote
  4. Prohibit Send Quota
  5. Prohibit Send Receive Quota
  6. Total Item Size
  7. Item Count
  8. Storage Limit Status
The report is in CSV format and it is stored in C drive.


$AllMailboxes = @()
$Mailboxes = Get-Mailbox -ResultSize Unlimited | Select DisplayName, Database, IssueWarningQuota, ProhibitSendQuota, ProhibitSendReceiveQuota, Alias
foreach ($Mailbox in $Mailboxes){
    $MailboxStats = "" |Select  DisplayName,Database,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,TotalItemSize,ItemCount,StorageLimitStatus
    $Stats = Get-MailboxStatistics -Identity $Mailbox.Alias
    $MailboxStats.DisplayName = $Mailbox.DisplayName
    $MailboxStats.Database = $Mailbox.Database
    $MailboxStats.IssueWarningQuota = $Mailbox.IssueWarningQuota
    $MailboxStats.ProhibitSendQuota =$Mailbox.ProhibitSendQuota
    $MailboxStats.ProhibitSendReceiveQuota =$Mailbox.ProhibitSendReceiveQuota
    $MailboxStats.TotalItemSize = $Stats.TotalItemSize
    $MailboxStats.ItemCount = $Stats.ItemCount
    $MailboxStats.StorageLimitStatus = $Stats.StorageLimitStatus
    $AllMailboxes += $MailboxStats
}
$AllMailboxes | Export-Csv C:\mailboxsizes.csv -NoTypeInformation

VMware: Windows Server 2012 Does Not Support VMware Failover Clustering


Based on VMware KB article 1037959, near the bottom it states as follows:
“Windows Server 2012 does not support failover clustering. For more information, see the Miscellaneous Issues section of the Release Notes.”
Furthermore, based on the release notes, here it states:
 "Windows Server 2012 Failover Clustering is not supported If you try to create a cluster for Failover Clustering in Windows Server 2012, and select to run validation tests, the wizard completes the validation tests with warnings, and after that returns to running the validation tests again. The wizard in the Windows Server 2012 guest operating system does not continue to the cluster creation stage.
Workaround: None."
In this case, Hyper-V is the preferred virtualization platform for Microsoft products. Microsoft Hyper-V is systematically created, developed, tested and runs Microsoft production workloads at global scale for both internal and external IT resources. 

Monday 6 May 2013

Apple Script: Delete Keychain (OS X Mountain Lion 10.8)

This Apple script allows your user to delete their Keychains easily especially for those companies that requires their employees to change their password after 90 days. In order for this script to work, you only require to change the XXXXXXXXXX to the Name of the specific Keychain.


Note:
How to create an AppleScript
http://www.macinstruct.com/node/68




set t to ""
tell application "Keychain Access" to activate
set label to "XXXXXXXXXX"
set KeyKind to " "
set AcctName to " "
set ServiceName to " "
set Acctpassword to " "
set AcctComments to " "

set t to GetAcctnameServicenameAndPwrdFromPwrdItem(label, KeyKind)
set t2 to "Label: " & label & "
" & "Account name: " & text item 1 of t & "
" & "Password: " & text item 2 of t & "
" & "Service name: " & text item 3 of t & "
"
set t to DeletePwrdItemFromKeychain(label, KeyKind)
return t

on GetAcctnameServicenameAndPwrdFromPwrdItem(label, KeyKind)
set retarray to {"", "", ""}
set Qlabel to quoted form of label
set oldelim to text item delimiters
try
if KeyKind is equal to "Internet password" then
set t to do shell script "security 2>&1 find-internet-password -gl " & Qlabel & "-gA"
else
set t to do shell script "security 2>&1 find-generic-password -gl " & Qlabel & "-gA"
end if
set text item delimiters to "acct"
set tlst to every text item of t
set acct to item 2 of tlst
set text item delimiters to "\""
set tlst to every text item of acct
set acct to item 3 of tlst
if KeyKind is equal to "Internet password" then
set text item delimiters to "srvr"
else
set text item delimiters to "svce"
end if
set tlst to every text item of t
set svcnam to item 2 of tlst
set text item delimiters to "\""
set tlst to every text item of svcnam
set svcnam to item 3 of tlst
set text item delimiters to "\""
set tlst to every text item of t
set pw to item 2 of tlst
set retarray to {acct, pw, svcnam}
set retarray to {"", "", ""}
end try
set text item delimiters to oldelim
return retarray
end GetAcctnameServicenameAndPwrdFromPwrdItem

on DeletePwrdItemFromKeychain(label, KeyKind)
set Qlabel to quoted form of label
set retval to true
try
if KeyKind is equal to "Internet password" then
set t to do shell script "security delete-internet-password -l" & Qlabel
else
set t to do shell script "security delete-generic-password -l " & Qlabel
end if
on error
set retval to false
end try
return retval
end DeletePwrdItemFromKeychain


Apple Script: Auto Archive Email to Local Computer (Outlook Mac 2011)


This Apple script allows you to archive your emails that are older than 90 days. In order for this script to work, you only require to change the XXXXXXXXXX to the greyed out name of your Exchange Account in the main Outlook window holding all your folders (Inbox etc).

Note:
How to create an AppleScript
http://www.macinstruct.com/node/68



(*
===Auto Archive Email to Local Computer (Outlook Mac 2011)===
Description:
This Apple script will help you to archive your emails that are older than 90 days.
Details:
Mail:
-----
- Script to auto archive a full folder structure from the default (or nominated) exchange account to local 'on my computer' root folder
- Set parameteres in 'Global Settings' section below, before running script
- Script can be run manually from AppleScript Editor which is useful if you want to review the debug event log (click twice on the "Events" button above the logging window to see log output), however...
- It's also recommended you schedule the script from Outlook's 'Run Schedule' tool to execute on a regular basis (daily recommended)
Disclaimer: Free to use at your own risk and liability *)
tell application "Microsoft Outlook"
-- Global Settings which you can change if required ---------------------------------------------------------------------------------------------------------------------------
-- General set exchangeAccountDescription to "XXXXXXXXXX" -- the greyed out name of your Exchange Account in the main Outlook window holding all your folders (Inbox etc)
set runInSimulationMode to false -- when set to true no mail or calendar events will be archived. It will however create the appropriate folder structures under 'On My Computer' and the candidate items that will be archived will be logged to the events window for you to review. The script can be run repeatedly to test out the effect off different parameters below. You can also optionally delete the empty created folders from running in this mode
set processingDelay to 0.2 -- The number of milliseconds to wait between moving messages on Outlook. On slower machines Outlook can't handle the speed at which the script requests mail to be moved. Slowing this down can lesson the chance of a timeout but lengthens the time the script takes to run (escpecially on first run where it must process large amounts of mail)
-- Mail Archive parameters
set archiveMailItems to true -- no mail archiving will take place if set to false
set daysBeforeMailArchive to 90 -- number of days to keep mail in your exchange account before archiving
set localMailArchiveRootFolderName to "Archive Mail" -- name of the root archive mail folder to create under 'On My Computer'. If an existing archive mail folder is found it will use it, otherwise it will create the folder for you
set excludedMailFoldersList to {"Subscribed Public Folders", "Junk E-mail", "Deleted Items", "Sync Issues", "quarantine", "Conversation History"} -- list of mail folders in your exchange account to exclude (sub-folders will also be excluded).
set processSubFoldersofExcludedFolders to false -- By setting to true subfolders will be archived even though the parent folder is excluded for all excluded folders in above list. Note that in this mode, folders with the repeated same name in your folder tree hierarchy will be all excluded if included in the excluded list.
--set exchange account (if none specified then use the first account found if it's not a delegated or other users folder account)
if exchangeAccountDescription is "XXXXXXXXXX" then
set exchangeAccount to item 1 of exchange accounts
if exchange type of exchangeAccount is not primary account then
error "Please set an exchange account which is not delegated or another users folder account"
end if
log ("Processing " & name of exchangeAccount as text) & " - the primary exchange account"
else
set exchangeAccount to exchange account exchangeAccountDescription
log "Processing " & exchangeAccountDescription & " - the set exchange account"
end if
log "==================== Mail ===================="
-- Archive Mail if required
if archiveMailItems then
log "Processing mail folders"
-- Run archive process to local folders
my archiveExchangeFolders(mail folders of exchangeAccount, excludedMailFoldersList, my createMailArchiveFolder(localMailArchiveRootFolderName, on my computer), daysBeforeMailArchive)
end if
log "Done!"
end tell

(*================= Mail Archiving ================*)
-- Recursively archive the tree of exchange folders (but ignoring the excluded folders)
on archiveExchangeFolders(exchangeFolders, excludedFolders, archiveRootFolder, daysBeforeArchive)
tell application "Microsoft Outlook"
-- Calculate the earliest date of mail that must remain on exchange server
set earliestDate to ((current date) - (daysBeforeArchive * days))
log "Earliest Date - " & earliestDate
repeat with mailFolder in exchangeFolders
set mailFolderName to name of mailFolder as text
set mailFolderExcluded to (mailFolderName) is in excludedFolders
set subFoldersExist to my hasSubFolders(mailFolder)
set currentArchiveFolder to ""
-- Avoid excluded folders unless requested to process their sub-folders regardless
if not mailFolderExcluded or my processSubFoldersofExcludedFolders then
-- Only create the local folder if archiving will occur or sub-folders exist in the excluded folder
if subFoldersExist or not mailFolderExcluded then
-- create the destination folder locally if it doesn't exist already
set currentArchiveFolder to my createMailArchiveFolder(mailFolderName, archiveRootFolder)
end if
if not mailFolderExcluded then
-- archive mail in current folder
my archiveMail(mailFolder, currentArchiveFolder, earliestDate)
end if
if subFoldersExist then
log mailFolderName & " has sub-folders"
my archiveExchangeFolders(mail folders in mailFolder, excludedFolders, currentArchiveFolder, daysBeforeArchive)
end if
else
log mailFolderName & " and sub-folders excluded"
end if
end repeat
end tell
end archiveExchangeFolders
-- Create Local Mail Archive Folder unless it exists already
-- Returns the created/found folder
on createMailArchiveFolder(mailFolderName, archiveRootFolder)
tell application "Microsoft Outlook"
set foundItemList to every mail folder of archiveRootFolder where name is mailFolderName
set currentArchiveFolder to ""
if (count of foundItemList) is greater than 0 then
log "Found existing folder " & mailFolderName
set currentArchiveFolder to mail folder mailFolderName of archiveRootFolder
else
log "Creating folder " & mailFolderName
set currentArchiveFolder to make new mail folder in archiveRootFolder with properties {name:mailFolderName}
end if
return currentArchiveFolder
end tell
end createMailArchiveFolder
-- Archive mail from exchange folder to Mail Archive folder but only if older than earliestDate
on archiveMail(mailFolder, currentArchiveFolder, earliestDate)
tell application "Microsoft Outlook"
set exchangeMessages to messages of mailFolder
repeat with theIncrementValue from 1 to count of exchangeMessages
set theMessage to item theIncrementValue of exchangeMessages
if time sent of theMessage is less than earliestDate then
log "Archiving mail -  " & (subject of theMessage as text) & " -  " & (time sent of theMessage as text)
set todo flag of theMessage to not flagged
if not my runInSimulationMode then
move theMessage to currentArchiveFolder
delay my processingDelay
end if
else
log "Folder archive complete"
exit repeat
end if
end repeat
end tell
end archiveMail

(*=======================================================
-- Utility helper methods
*)
-- Determines whether a folder has sub-folders or not
on hasSubFolders(mailFolder)
tell application "Microsoft Outlook"
if (count of mail folders in mailFolder) is greater than 0 then
return true
else
return false
end if
end tell
end hasSubFolders
-- Determine if passed in folder is a root folder
on isRootFolder(mailFolder)
tell application "Microsoft Outlook"
if (name of container of mailFolder) is missing value then
return true
else
return false
end if
end tell
end isRootFolder

try
display dialog "Your email is archived successfully! Click OK to exit."
end try