Thursday 20 June 2013

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

This Powershell script allows you to notify your users ( with multiple attachments ) 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 with multiple attachments 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 2010 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,$attach,$subject,$body)
$smtp = new-object system.net.mail.smtpClient($SmtpServer)
$mail = new-object System.Net.Mail.MailMessage
$mail.from = $from
$mail.to.add($to)
foreach ($filetoattach in $attach)
{
$att = New-Object Net.Mail.Attachment($filetoattach.fullname)
$mail.attachments.add($att)
}
$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 -attach $null -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)."
$files = Get-ChildItem “C:\Guides”
             # 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 attachments for the quick guides." + $newline + $newline
                        $body += "For Windows user:" + $newline
                        $body += "Change_Password_Windows.pdf" + $newline + $newline
                        $body += "For Mac user:" + $newline
                        $body += "Change_Password_Mac.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 -attach $files -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 -attach $null -subject $subject -body $body
}
# End of script 

Tuesday 18 June 2013

IT Technology: Geo-Socialization ( Mega Trends )

Mega Trends

What will be the Mega Trends that will shape and influence the world by the end of this decade? Frost & Sullivan which has has launched a Visionary Innovation Research Programme has identified several interest trends:  development of Mega cities, regions and corridors, "Smart" emerging as the new Green, Geo Socialization, Innovating to Zero, Beyond BRIC: The Next Game Changers, Space Jam, Personal Robots, e-Mobility and New Business Models, to name a few.

The objective of Frost & Sullivan research  is to provide companies with special reports to focus on the evolution of these global trends to help them drive growth and innovation in a rapidly changing environment, a press release said.

A brave new world emerges from Frost & Sullivan's recent research, "World's Top Global Mega Trends to 2020 and Implications to Business, Society and Cultures." According to the analysis, sustainability was one of the major Mega Trends that shaped human, organisation and government behavior in the last decade. The study forecasts health, wellness and well-being with a much wider definition than mere healthcare, which will include body, mind and soul as the most important factor of discussion and differentiation in this decade. It reveals that women empowerment will reach new heights, with one in three workers being a woman and up to 40 percent of boardrooms in some nations comprising women by 2020. The world will also witness reverse brain drain, wherein the vast vacancies for CXOs in countries like India will be filled not only by returning Indians, but also by Americans and Europeans seeking better prospects.

Frost & Sullivan Partner, Sarwant Singh explains: "Frost & Sullivan defines Mega Trends as global, sustained and macroeconomic forces of development that impact business, economy, cultures, careers and personal lives, thereby defining our future world and its increasing pace of change."

Mr Singh adds: "The unique feature of this Visionary Innovation Research Programme, compared to other predictive programmes out there, lies in its ability to not only identify and evaluate emerging Mega Trends, but to also to translate those opportunities to everyday business and personal life -- the macro to micro approach. In other words, we are not just throwing out forecasts for the future, but showing organizations immediate opportunities and threats in the here and now."

There will be many interesting Mega Trends to watch out for. First, future urbanization will drive integration of core city centres or downtowns with suburbs and satellite cities, resulting in expanding boundaries from the current average of 25 miles (40 km) to around 40 miles (64 km). We will witness the emergence of 30 Mega-cities, 15 Mega-regions and at least 10 Mega-corridors with over 20 million people by 2020. Urbanization will lead to new hub and spoke business models for healthcare, logistics, retailing and many other functions, forcing organizations to re-think their 'Urban' business model.

Second, e-Mobility will redefine personal mobility in the future. Over 40 million electric vehicles, including electric pedal cycles, scooters, four-wheelers and buses will be sold annually around the globe in 2020. The opportunity in the e-Mobility market is not in making cars but in its value chain, batteries (including second life and recycling), charging stations and packaging innovative mobility solutions such as 'pay by electrons.'

The next level of social networking will focus on geographic services and capabilities such as geocoding and geotagging to enable additional social dynamics. User-submitted data with profiles and interests will be matched with location-based services to connect and co-ordinate with surrounding people or events. This type of geo-networking will drive markets, businesses and individuals to interact, advertise and promote in real time.

Another trend identified by Frost & Sullivan is Innovating to Zero. This trend examines a world of zero emissions, zero accidents, zero fatalities, zero defects, zero breaches of security and carbon-neutral factories.


Geo-Socialization

In the year 2020 at the busiest street in town, imagine yourself walking down the street one afternoon and your mobile phone gives you the following alerts:

  • Your buddy is at a bar nearby 
  • Your favorite restaurant down the street is offering a special on your favorite food
  • A shop around the corner is offering a discount sale on your preferred clothing line

Welcome to the future of social networking: Geo Socialization. While you might be conflicted in choosing the best option from these different alerts, this next generation of socialization will work on geographic services and capabilities, such as geocoding and geotagging, to enable additional social dynamics. In simple terms, your profile and interests and other user-submitted data will be matched with location-based services to connect and coordinate with surrounding people or events (such as meet-ups, concerts, or nightclub and restaurant reviews).

The possibilities and opportunities of geo socialization are endless; we are talking about a world where markets, businesses and individuals are driven by the need to interact, advertise and promote in real time. This will result in new trends of digital marketing, socializing and networking, furthering the evolution of interaction between individuals and organizations. Business will now thrive on new digital marketing tools, promotions and offers. For example, real estate agents will advertise properties on sale and provide specs on value/price and address. An information bar with contact numbers will enable such businesses to capitalize on opportunities and potential contacts on a real-time basis. This would imply that businesses will soon need to be equipped with the infrastructure and resources to respond to real-time demand to cater to a whole new spectrum of customers who react to geographically tagged services. Additionally, this trend will also force investments from the retail, entertainment and hospitality industries to upgrade their systems with new IT software to enable these services, thereby bringing a new source of revenue to mobile operators and IT software and system houses. It will allow these industries to manage their inventory in real time and push promotions when inventory piles up or to fill capacity, as in empty restaurants.

Meeting potential customers can be extended to various scenarios. A series of alerts about different users in a business conference would help a user network with potential clients and probably on a job prospect as well! Background information on different users about their interests or business domain will enhance networking skills and broaden the list of contacts.

Layar, the world’s first mobile augmented reality browser now available in the market, is a step toward this vision. Layar operates using a combination of GPS, mobile phone camera and compass to identify a user’s location and retrieve information on geographical coordinates that can be seen through the camera view. By simply pointing the visual search engine in any direction, Layar gives information on exciting places, clubs, bars, cash machines, restaurants, shops and theaters. However, Frost & Sullivan envisions a more sophisticated and real-time location mapping system to develop and evolve, furthering the dimensions of social networking and collaboration from that which Layar currently offers. Geo socialization will not only point out exciting places but will match interests with services, location and people around the user, resulting in a more customized way of networking.

Technologies and software are currently being developed toward this MegaTrend. Geo socialization will change the way we think, move, interact, communicate, do business and capitalize on opportunities in the future. So while we are busy Twittering and using Facebook in 2010, let us welcome this new technology and geographical-based type of socialization that will influence our social lives for years to come.


References:
1.  Mega Trends 2020: Suburban growth, Geo socialization, e-mobility

2.  Geo Socialization: The Next Trend in Social Networking

VMware: vSphere HA Agent is in the Network Partitioned State

The vSphere HA agent on a host is in the Network Partitioned state. User intervention might be required to resolve this situation.

Problem:
While the virtual machines running on the host continue to be monitored by the master hosts that are responsible for them, vSphere HA's ability to restart the virtual machines after a failure is affected. First, each master host has access to a subset of the hosts, so less fail-over capacity is available to each host. Second, vSphere HA might be unable to restart a Secondary VM after a failure.

Cause:
A host is reported as partitioned if both of the following conditions are met:
  • The vSphere HA master host to which vCenter Server is connected is unable to communicate with the host by using the management network, but is able to communicate with that host by using the heartbeat datastores that have been selected for it.
  • The host is not isolated.

A network partition can occur for a number of reasons including incorrect VLAN tagging, the failure of a physical NIC or switch, configuring a cluster with some hosts that use only IPv4 and others that use only IPv6, or the management networks for some hosts were moved to a different virtual switch without first putting the host into maintenance mode.

Solution:
Resolve the networking problem that prevents the hosts from communicating by using the management networks.


Reference:
1.  vSphere Troubleshooting

VMware: ESXi Hang / Stuck /Slow during Startup


VMware ESX and VMware ESXi are bare metal embedded hypervisors that are VMware's enterprise software hypervisors for guest virtual servers that run directly on host server hardware without requiring an additional underlying operating system.

The basic server requires some form of persistent storage (typically an array of hard disk drives) that stores the hypervisor and support files. A smaller footprint variant, ESXi, does away with the first requirement by permitting placement of the hypervisor on a dedicated compact storage device. Both variants support the services offered by VMware Infrastructure.

Please note that if you experience an issue (hang / stuck / slow) while restarting your ESXi host(s), this issue is due to USB Arbitrator service which manages USB pass-through. This service does not support simultaneous USB connections both from USB devices and from USB service console.

One of the options to solve this issue is by waiting the host to boot up and disabling USB arbitrator service auto-start on next reboot at the ESXi console:

chkconfig usbarbitrator off

Otherwise, you can reboot the host, actually for me once booted up host it worked fine, so if you need to disable USB arbitrator service without rebooting:

service usbarbitrator stop


References:
1.  VMware vSphere® 5.1 Release Notes

2.  ESXi 5.1: Stuck on running usbarbitrator start

3.  VM ESXI 5.1 hangs when starting vmfs3 loaded successfully

Cisco: UCS C200 and C210 Servers Windows Server 2012 or Windows Server 2008 R2 Installation Fail

Cisco UCS C210 M2 server is a general- purpose, 2-socket, 2 rack unit (RU) rack server that balances performance, density, and efficiency for storage-intensive workloads. The system is built for applications such as network file servers and appliances, storage servers, database servers, and content-delivery servers.

Building on the success of the UCS C-Series servers, the UCS C210 M2 server extends the capabilities of the Cisco Unified Computing System, using Intel's latest Xeon 5600 Series multicore processors to deliver even better performance and efficiency.

Please note that if you have a Cisco UCS C200 or C210 rack-mount server with a Intel Quad port GbE HBA adapter, you must uninstall it before you install Windows 2012 or Windows 2008 R2 on the server. You may reinstall it later, but if the adapter is present during Windows installation, the installation will fail citing an unexpected error.


References:
1.  Cisco UCS C210 M2 General-Purpose Rack Server
http://www.cisco.com/en/US/products/ps10889/index.html

2.  Windows Server 2012 and Windows Server 2008 Installation
http://www.cisco.com/en/US/docs/unified_computing/ucs/os-install-guides/windows/CSERIES-WINDOWS_chapter_011.html

Sunday 16 June 2013

Veeam: Unable to Migrate vApp Virtual Machines from Instant Recovery to Production

Veeam Backup & Replication provides powerful, easy to use, and affordable data protection for virtualized applications and data on VMware vSphere. It unifies backup and replication in a single solution and its patented vPower technology leverages virtualization to reinvent data protection. There are no agents to manage, no need to babysit backup jobs, and you can verify the recover-ability of every backup, every time.

Instead of making users wait while you provision storage, extract the backup and copy it to production, restart a VM directly from the backup. With Instant VM Recovery, you can recover a failed VM in as little as 2 minutes. Please note that Veeam is unable to migrate vApp virtual machines from Instant VM Recovery to production. (based on practical results)


Reference:
1.  Veeam Backup & Replication for VMware and Hyper-V

Wednesday 12 June 2013

APC: Switched Rack PDU (Power Distribution Unit)

APC Switched Rack Power Distribution Units (PDUs) enable advanced, user-customizable power control and active monitoring. Remote outlet level controls allow power on/off functionality for power recycling to remotely reboot equipment and restrict unauthorized use of individual outlets. Power sequencing delays allow users to define the order in which to power up or down attached equipment. Avoid circuit overload during power recovery and extend up-time of critical equipment by prioritizing the load shedding. Current metering provides real-time remote monitoring of connected loads. Switched Rack PDUs include real power monitoring, a temperature/humidity sensor port, locking IEC receptacles, and low profile circuit breakers. User-defined alarms warn of potential circuit overloads before critical IT failures occur. Users can access, configure, and control Switched Rack PDUs through secure Web, SNMP, or Telnet Interfaces and is complimented by APC Centralized Management platforms using InfraStruxure Central, Capacity Manager and Change Manager.

Availability:
  • Network management
  • Remote individual outlet control
  • Alarm thresholds
  • Local current monitoring display
  • Power delays
  • Load indicator LED
  • Flash upgradeable
  • Integrates with InfaStruXure central
Agility:
  • Rack-mountable
  • Single input power source
  • Wide range of input and output connections

References:
1.  Switched Rack PDU

2.  APC Rack PDU

IT Technology: Inductive Charging / Wireless Charging / Cordless Charging


Inductive charging (Wireless charging or Cordless charging) uses an electromagnetic field to transfer energy between two objects. This is usually done with a charging station. Energy is sent through an inductive coupling to an electrical device, which can then use that energy to charge batteries or run the device.

Induction chargers typically use an induction coil to create an alternating electromagnetic field from within a charging base station, and a second induction coil in the portable device takes power from the electromagnetic field and converts it back into electrical current to charge the battery. The two induction coils in proximity combine to form an electrical transformer.

Greater distances between sender and receiver coils can be achieved when the inductive charging system uses resonant inductive coupling.


Here are the pros and cons of the inductive charging:

Pros
  • Lower risk of electrical shock or shorting out when wet because there are no exposed conductors, for example toothbrushes and shavers, or outdoors
  • Protected connections - no corrosion when the electronics are all enclosed, away from water or oxygen in the atmosphere
  • Safer for medical implants - for embedded medical devices, allows recharging/powering through the skin rather than having wires penetrate the skin, which would increase the risk of infection
  • Convenience - rather than having to connect a power cable, the device can be placed on or close to a charge plate or stand
  • Easier than plugging into a power cable (important for disabled people)


Cons
  • Lower efficiency, waste heat - The main disadvantages of inductive charging are its lower efficiency and increased resistive heating in comparison to direct contact. Implementations using lower frequencies or older drive technologies charge more slowly and generate heat within most portable electronics
  • More costly - Inductive charging also requires drive electronics and coils in both device and charger, increasing the complexity and cost of manufacturing
  • Slower charging - due to the lower efficiency, devices can take longer to charge when supplied power is equal
  • Inconvenience - When a mobile device is connected to a cable, it can be freely moved around and operated while charging. In some implementations of inductive charging (such as the Qi standard), the mobile device must be left on a pad, and thus can't be moved around or easily operated while charging. In practice, this defeats the point of wireless charging as the convenience factor is removed
  • Incompatibility - Unlike (for example) a standardized MicroUSB charging connector, there are no de facto standards, potentially leaving a consumer, organization or manufacturer with redundant equipment when a standard emerges. (Note: Qi has become a standard adopted by many companies such as Google and Nokia.)

For your information, newer approaches reduce transfer losses through the use of ultra-thin coils, higher frequencies, and optimized drive electronics. These results in more efficient and compact chargers and receivers, facilitating their integration into mobile devices or batteries with minimal changes required. These technologies provide charging times comparable to wired approaches, and they are rapidly finding their way into mobile devices. For example, the Magne Charge vehicle recharger system employs high-frequency induction to deliver high power at an efficiency of 86% (6.6 kW power delivery from a 7.68 kW power draw).


References:
1.  Wireless Charging

2.  2013 Best Wireless Charger Comparisons and Reviews

3.  Energizer Inductive Charger Review

Thursday 6 June 2013

APC: Automatic Transfer Switches (ATS)


APC Rack Automatic Transfer Switches (rack ATS) provide reliable, redundant power to single-corded equipment. The rack ATS has dual input power cords supplying power to the connected load. If the primary power source becomes unavailable, the rack ATS will seamlessly source power from the secondary source without interrupting critical loads. The Rack ATS has built-in network connectivity, which allows for remote management via Web, SNMP, or Telnet interfaces.


Advantages:
  • Quick Transfer Rate

Transfer rate is within the industry standard and within the time power supplies will typically drop loads. The transfer of one power source to another is seamless to the connected equipment avoiding disruption of equipment performance.

  • Wide range of input and output connections

Product family includes a variety of input and output connections to distribute 120V, 208V, or 230V power to multiple outlets. Having a variety of inputs and outputs allow users to adapt to varying power requirements. APC offers units that bring up to 14.4kW using a single branch whip.

  • Remote Management Capabilities

Full-featured network management interfaces that provide standards-based management via Web, SNMP, and Telnet. Allows users to access, configure, and manage units from remote locations to save valuable time. Associated with this feature is the ability to quickly and easily upgrade the firmware via network download to installed units for future product enhancements.

  • Dual Input Power Sources


Supplies redundant AC power to connected equipment. Two AC lines power the unit and if the primary AC power fails, the unit will automatically switch to the alternative power source.



References:
1.  Rack-mount Transfer Switches

2.  APC AP7750 Automatic Transfer Switch Review