2013/04/02

PowerShell/WinForm - Active Directory User Unlocker


An Active Directory account may be automatically locked, if the domain's security policy has been configured to lock accounts after a number of unsuccessful logon attempts.

If an account has been locked out, the lockouttime attribute will contain a Win32 time value that indicates when the account was locked.

An easy way to search for locked out accounts is an LDAP query similar to
(&(objectClass=user)(lockoutTime=>0))




You can integrate this query in the saved queries of your Active Directory Users and Computers MMC.



Description


The following script will use PowerShell to generate a WinForm and give you the ability to unlock account right from the interface. The goal is to do something simple and functional, nothing fancy.

The GUI was created using PowerShell Studio from SAPIEN. You can try this tool by going on Sapien.com

No Module Required


The beautiful part of it is that no Active Directory Module or Quest Active Directory Snapin are required
In my case I used ADSI: [ADSISearcher]

If you want to know more about ADSISearcher check this article from the Scripting Guy

Graphical User Interface



Under Windows 8

2013/04/01

Deploying and Configuring vCenter Server Appliance 5.1

In this post I will describe how I installed and configured vCSA in my Home Lab from the vSphere Client. I will also show how to access the vSphere Web client once the installation is completed.

What is VMware vCenter ?

Before I start, It should be good to revisit the definition of VMware vCenter.

VMware vCenter Server provides a centralized and extensible platform for managing virtual infrastructure. VMware vCenter Server, formerly VMware VirtualCenter, manages VMware vSphere environments allowing IT administrators simple and automated control over the virtual environment to deliver infrastructure with confidence.

  • Provides centralized control and visibility at every level of virtual infrastructure
  • Delivers the security and availability of vSphere through automated proactive management
  • Empowers a broad partner ecosystem to extend virtualization capabilities

2013/03/29

2013/03/26

How to Deploy an OVF Template from a Remote Web Server



In the following post I am going to explain how to deploy an OVF Template from an URL.


The VMware vSphere Client allows you to deploy and export virtual machines, virtual appliances, and vApps stored in Open Virtual Machine Format (OVF).

An appliance is a pre-configured virtual machine that typically includes a preinstalled guest operating system and other software.





Methods to deploy an OVF Template
Using vSphere Client you have a couple of methods available to you :
  • Remote web server (URL)
  • Local Disk, USB keychain drives or CD/DVD drives
  • Shared network drives
  • OVFTool (Command-line utility from VMware that allows you to import and export OVF packages to and from a wide variety of VMware platform products.)

In most cases, Administrators would probably browse their Local Disks or Network Shares.
However, In my case I want to deploy a template using the local datastore of my ESXi host, using an URL.

2013/03/05

The Simplest Way to Create a Bootable Windows Server 2012 or Windows 8 USB Key

After I passed my VCP510-DV last week, I wanted to rebuild my Home Lab using Windows Server 2012 for the Storage part, instead of FreeNas.

Part of the rebuild, I needed to install Windows Server 2012 on top of the old FreeNas box. Hard task since I don't have a DVD player in the case... :-/

Hence, USB Boot it is...

I was surprise to see how easy it is to create a Bootable Windows Server 2012 (R1 or R2)/Windows 8/8.1 USB Key.

What do you need:




Once Installed, Launch Windows 7 USB/Download Tool
The first step is to select your ISO

2013/02/25

The PowerShell Certification

Update 2013/07/07: It seems that the Certification is now ONLY available after doing the in-person class offered by Concentrated Technology :-(

Don Jones just announced the creation of the PowerShell "Certification"!!

This is available for anybody who want to test their PowerShell scripting knowledge. The PowerShell "certification" is under the VERIFIED EFFECTIVE™ brand.

The certification name: Windows PowerShell 3.0 Toolmaking. 


More information:



To pass the certification you will need to pay the Examination cost (150$) and complete/return the Program License Agreement file. Once those steps complete you will then receive your scenario.

2013/02/18

Winter Scripting Games 2013 - Practice Event 2


Just a quick post on the script I submit for the second practice event of the Winter Scripting Games 2013 (last week).


Practice Event 2 - Covering Your Assets
Your organization is preparing to renew maintenance contracts on all of your server computers. You need to provide management with a report that details each inventory information for each server. Most of the servers do not have Windows PowerShell installed. None of the servers a separated from your client computer by a firewall. Computer names may be specified by a variety of means; your function must accept any collection of strings as computer names.

Minimum Requirements 
Optional Criteria 
  • Display optional verbose output showing the computer name being contacted
  • Prompt for computer names if none are specified when the function is run
  • Accept computer names as strings from the pipeline
Desired Output 
  • ComputerName Model Manufacturer LogicalProcs PhysicalRAM BIOSSerial

My Script

# NAME  : Get-ComputerInventory
# AUTHOR: Francois-Xavier Cat
# EMAIL : fxcat@LazyWinAdmin.com
# DATE  : 2013/02/10 

Function Get-ComputerInventory {
        <#
        .SYNOPSIS 
        The Get-ComputerInventory function gets information about a local or 
        Remote machine(s) specified by the parameter ComputerName.
    

2013/02/10

Winter Scripting Games 2013 - Practice Event 1

The Winter Scripting Games 2013 started last week with the first practice event.

Unfortunately for me, I was not able to post my script on time. The first Practice event was due on the Tuesday, 5th of February... 11:59 PM GMT! I assume I had until midnight my time..... (My timezone is East GMT-5) 
;-(

If you want to join the Winter Scripting Games, check the following TheScriptingGames website for more information and the The Competitor Guide.

Summary: Practice Event 1 - Sizing up the Disks
You have been asked to create a Windows PowerShell advanced function named Get-DiskSizeInfo. It must accept one or more computer names, and use WMI or CIM to query each computer. For each computer, it must display the percentage of free space, drive letter, total size in gigabytes, and free space in gigabytes. If a specified computer cannot be contacted, the function must log the computer name to C:\Errors.txt and display no error message.
Minimum Requirements 
Optional Criteria
  • Display optional verbose output showing the computer name being contacted

My Script

Function Get-DiskSizeInfo {
        <#
        .DESCRIPTION
        Check the Disk(s) Size and remaining freespace.

        .PARAMETER ComputerName
        Specify the computername(s)

        .INPUTS
        System.String

        .OUTPUTS
        System.Management.Automation.PSObject