Category: PowerShell

Use PowerShell to Determine When Your DHCP Lease Expires

This blog post applies to only Windows 8 and Windows Server 2012. Want to know how much time there is until your current DHCP leases expire? I have 23 hours, 47 minutes, and 46 seconds until my current DHCP lease expires on one of my network interfaces and 22 seconds more than that left on the other one. Want to know the exact date and time of when they expire? I haven't added any error handling to these scripts so if Read more [...]

Targeting Down Level Clients with the Get-CimInstance PowerShell Cmdlet

This past weekend, I attended PowerShell Saturday 002 in Charlotte, NC. One of the sessions I attended was "Discovering the Power of WMI & PowerShell in the Enterprise" by Brian Wilhite. One of the cool things that Brian covered in his session was how to use the new PowerShell version 3 Get-CimInstance cmdlet to target down level clients that don't have PowerShell installed or don't have PowerShell remoting enabled. There's no parameter to change the protocol on the actual Get-CimInstance Read more [...]

Use PowerShell to Display IIS Application Pool Identity Account Passwords in Clear Text

It's fairly common to see the identity for an IIS application pool changed to a domain user account. The following image shows three application pools, the DefaultAppPool has the default settings, the www app pool has a Managed Service Account specified, and the wwwDev app pool has a standard domain user account specified: When a standard user account is specified, the password is entered as shown below: I've used what you would think is a super secure password, generated by KeePass: When Read more [...]

PowerShell Saturday 002 | Charlotte NC | September 15, 2012

If you haven't heard, there's a PowerShell Saturday technology event this weekend in Charlotte, NC (Saturday, September 15, 2012). It's going to be awesome based on the list of sessions and speakers they have lined up which rivals conferences that cost hundreds or possibly even thousands of dollars to attend. It's also similar to the SQL and SharePoint Saturday technology events that I've attended for the past few years so I can speak from experience, they're definitely worth the time and effort Read more [...]

A Quarter of a Million Hits & MrPowerShell.com Announcement

This month makes 3 years that this blog site (mikefrobbins.com) has been live. I'll reach a quarter of a million hits on this blog site before the end of the day today! You'll notice that PowerShell has become more and more the focus of what I'm blogging about. See how much larger the word "PowerShell" is than everything else in the category cloud on the right side of this site. Why? Because it's the future of system administration. If you're only interested in the PowerShell category of this Read more [...]

Use PowerShell to Check for Processor (CPU) Second Level Address Translation (SLAT) Support

The hardware requirements for using Hyper-V to run virtual machines on a Windows 8 client states that a 64-bit system that has a processor (CPU) that supports Second Level Address Translation (SLAT) is required. A minimum of 4GB of RAM is also required. How do I know if my Processor (CPU) supports Second Level Address Translation? You could do like most blogs on the Internet state and use Coreinfo: You have two additional choices if you already have Windows 8 or Windows Server 2012 Installed. #1 Read more [...]

Finding Aliases for PowerShell Cmdlet Parameters

Many PowerShell cmdlet parameters have aliases such as "Cn" for ComputerName. These aliases aren't well documented and even viewing the full help for a cmdlet doesn't show them. The following command can be used to display a list of all the parameters for a particular PowerShell cmdlet and any aliases that exist for those parameters: One thing to keep in mind is this is a list of all the parameters from all parameter sets which means some of them are mutually Read more [...]

How to Install the Exchange 2010 Management Tools on Windows 8 RTM

This is definitely unsupported so be sure to read the disclaimer on the right side of this blog before continuing. Read this blog article completely before attempting this process. You've just reloaded your work computer with Windows 8 RTM that you downloaded from MSDN or TechNet and you need to install the Exchange Server 2010 Management Tools so you can manage your Exchange server without having to log into it whether it be with the GUI or with PowerShell. In this example, I run setup.exe Read more [...]

Error 0x800F0906 When Trying To Add .NET Framework 3.5 to Windows 8 RTM

The Windows 8 RTM was released yesterday to TechNet subscribers and this morning I decided to start the day off by reloading my business computer. I've been running the Release Preview on a netbook and on some VM's without issue. Everything seemed to go well until I tried to load several applications that required the .NET Framework 3.5. Each of them failed to install stating they were unable to add the .NET framework so I decided to install it manually. Here's the process I used to try to install Read more [...]

Working with WMI Just Got a Lot Easier Thanks to PowerShell Version 3

Working with WMI just got a lot easier thanks to the new tabbed expansion feature of the Get-CimInstance cmdlet in PowerShell version 3 that makes discovering namespaces and classes a much simpler process. A static blog wouldn’t do this feature justice so I decided to record a video for this one:


Let me know what you think and if you would like to see more of these types of videos.

µ

Use Data Stored in a SQL Server Database to Create Active Directory User Accounts with PowerShell

I need a few Active Directory users created in my mikefrobbins.com test environment so I thought why come up with fake information when I could use information that I already have in a SQL Server database? The Employees table in the Northwind database looks like an easy enough candidate since all the data I need is in one table. This is about the concept and not about seeing how complicated I can make this process. Here's the type of information I'll pull out of this database to use for the Active Read more [...]

Can the PowerShell ISE be Installed on Windows Server 2012 Server Core Installation?

I noticed a few days ago that the PowerShell ISE is an available feature on Windows Server 2012 Release Candidate when running the Server Core Installation (no GUI): Does that mean the PowerShell ISE can run on Server Core in Windows Server 2012 unlike in Windows Server 2008 R2? Let's find out. The installation takes a long time and then you're prompted to restart when it's complete: Finally when the restart is finished and you log in, Server Manager will be loaded and you'll discover that Read more [...]

Querying a SQL Server Database from PowerShell

A few days ago, I wrote a PowerShell script on my computer that would ultimately be used on a different computer to automate a specific task. One of the things this script did was to query a SQL Server database which worked fine on my computer. After moving the script, it didn't take long to figure out that the other computer didn't have the necessary SQL PowerShell snap-in or module. My goal was to install the minimum features of SQL Server 2008 R2 to be able to run Transact SQL from PowerShell Read more [...]

No Soup, I Mean No PowerShell -Version 2 For You Windows 8 and Windows Server 2012

Be sure to start off by reading my previous blog article titled "Error When Running PowerShell -Version 2 on Windows 8 and Windows Server 2012" if you have not previously read it since attempting to run PowerShell in version 2 mode generates an error on a default installation of Windows 8 or Windows Server 2012. In PowerShell version 3, you can access PowerShell version 2 by running "PowerShell.exe -Version 2" (or "powershell -v 2"): Windows 8 Release Preview The PowerShell version 2 Read more [...]

Error When Running PowerShell -Version 2 on Windows 8 and Windows Server 2012

Windows 8 Release Preview On a fresh installation of the Windows 8 Release Preview, when attempting to run PowerShell.exe -Version 2, you'll receive the following error: "Version v2.0.50727 of the .NET Framework is not installed and it is required to run version 2 of Windows PowerShell." The following error message is generated if you attempt to run the same command from the PowerShell ISE: "powershell : V e r s i o n v 2 . 0 . 5 0 7 2 7 o f t h e . N E T F r a m e w o r k i s Read more [...]