2013/05/11

Scripting Games 2013 - Advanced Event 3 - A Disk Decision

This is my solution for the Advanced Event #3.
Unfortunately I don't expect a very high score in the Leader board since I did not submit the good version of my script... Shame.... But anyway I learned a bit from this event and wanted to share my solution. Hope this help someone out-there.

Instruction
Download [SkyDrive]


Dr. Scripto has been fielding a lot of calls from the Help Desk lately. They’ve been asking him to look up information about the local hard drives in various servers – mainly size and free space information. He doesn’t mind helping, but all the requests have been getting in the way of his naps. He’s asked you to write a tool comand that can get the information for the help desk – and theywants the output in an HTML file. The HTML file should look something like this:
The Doctor says you should parameterize your command – he wants to be able to pipe in one or more computer names as strings.The resulting HTML does need to go into an HTML file on disk someplace, and that file should have the computer name (e.g., the computer SERVER1 should have Server1.html, SERVER2 should have server2.html, and so on). A parameter should let him indicate the path (directory) to write the files to. Also, he wants you to pay special attention to the following:
  • The browser displays “Disk Free Space Report” in the page tab when viewing the report.
  • “Local Fixed Disk Report” is in the H2 (“Heading 2”) HTML style.If you can actually add the computer name to that – bonus!
  • The report ends with an HTML horizontal rule and the date and time that the report was generated.
  • The size and free space values are shown as gigabytes (GB) and megabytes (MB) respectively, each to two decimal places.
The command you write can assume that both WMI and CIM are available on the remote computers, and that all the necessary firewall rules and authentication have already been taken care of.

Solution

Finding the disk information
We'll have to use WMI/CIM to get this information on the remote computers.
To find which class to use, I typed the following commands:

Get-CimClass *disk*
Get-CimClass *disk* -PropertyName *size*

2013/05/08

Scripting Games 2013 - Advanced Event 2 - An Inventory Intervention

Now that event 2 is closed for new entries. Here is the solution I proposed.

Instruction 
Download the instruction here [skydrive]

Dr. Scripto finally has the budget to buy a few new virtualization host servers, but he needs to make some room in the data center to accommodate them. He thinks it makes sense to get rid of his lowest-powered old servers first… but he needs to figure out which ones those are.
This is just the first wave, too – there’s more budget on the horizon so it’s possible he’ll need to run this little report a few times. Better make a reusable tool.

All of the virtualization hosts run Windows Server, but some of them don’t have Windows PowerShell installed, and they’re all running different OS versions. The oldest OS version is Windows 2000 Server (he knows, and he’s embarrassed  but he’s just been so darn busy). The good news is that they all belong to the same domain, and that you can rely on having a Domain Admin account to work with.

The good Doctor has asked you to write a PowerShell tool that can show him each server’s name, installed version of Windows, amount of installed physical memory, and number of installed processors. 
For processors, he’ll be happy getting a count of cores, or sockets, or even both – whatever you can reliably provide across all these different versions of Windows. He has a few text files with computer names – he’d like to pipe the computer names, as strings, to you tool, and have your tool query those computers.

Key Points

  • Some Remote Server don't have PowerShell
  • Different OS versions (oldest is Window Server 2000)
  • Domain Environment, Domain Admin credential.
  • Output of the script: ServerName, Version of Windows, Amount of Physical Memory, Processors Count, Sockets Count, Cores Count.
  • Script can receive ComputerName injected via the pipeline

2013/05/07

PowerShell Summit NA 2013 - Recorded Videos

Recently I was lucky enough to attend the PowerShell Summit in Redmond,WA, this was a great opportunity to meet a lot of PowerShell people, MVPs, Writers, Bloggers, Trainers, IT Pros, DevOps, ... and some members of the PowerShell Team who created this amazing tool.



One of the Summit attendee Aaron Hoover recorded some of the sessions he attended using his webcam.

Find bellow the list of session available on his Youtube Account:


You can also download the materials used by the presenters and the list of sessions on PowerShell.org.

Thanks for Reading! If you have any questions, leave a comment or send me an email at fxcat@lazywinadmin.com. I invite you to follow me on Twitter: @lazywinadm

2013/04/30

Scripting Games 2013 - Advanced Event 1 - An Archival Atrocity

Last week I was one of the lucky PowerShell Summit attendees and had the chance to assist to the official launch of the Scripting Games 2013 !! (with a special video created by Sean ;-)

Apart from the PowerShell stars like Ed Wilson, Don Jones, Bruce Payette, Alan Renouf, Lee Holmes, Richard Siddaway, Jeffery Snover.... I met some awesome people there and It was really cool to talk about our passion for PowerShell, How this amazing tool is saving our life each days!

Scripting Games 2013 - Advanced Event #1 - An Archival Atrocity

For the first time, I decided this year to participate to the Scripting Games 2013 organize and hosted by the PowerShell.org team.

I chose the Advanced Track and here is the first script I submitted yesterday.

Feel free to comment and send me your critics.

2013/04/02

2013 Scripting Games - Competitor Guide


Don Jones just released the Competitor Guide for the 2013 Scripting Games online.

This year the Games will be hosted by PowerShell.org (Previous ones where organize by the Scripting Guy Ed Wilson). This event is scheduled to start during the PowerShell Summit in Seattle (between the 22nd and the 24th of April).

Make sure to read the Guidelines and check the different tracks available to you (Beginner or Advanced).

Download the Competitor Guide [PDF]

The Scripting Games is a great event for those who want to learn more or improve their skills with Windows PowerShell. I'm planning myself to participate to the Advanced Event. My Script will be post and explained here.


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