All posts filed under: PowerShell

Bangalore ITPro and PowerShell Bangalore User Group meeting, July 2013

PowerShell Bangalore User Group (@PSBUG) and Bangalore IT Pro (@BangaloreITPro) are meeting on July 27th, 2013. Agenda: 10.00AM – 10.15AM – Registrations and Welcome note 10.15AM – 10.45AM – PowerShell for Beginners – Deepak Dhami 10.45AM – 11.15AM – Introduction to Excange Calculator – Krishna Kumar B 11.15AM – 11.30AM – Break 11.30AM – 12.00Noon – PowerShell 4.0 – First Look – Ravikath Chaganti 12.00Noon – 12.30PM – Building GUI for PowerShell Scripts – Vinith Menon Registration is free: http://bitprojuly2013.eventbrite.com

Session on PowerShell 4.0 Desired State Configuration (DSC) – India Virtual Tech Conference, 1st August 2013

I will be speaking at the Virtual Tech Conference (VTC) on Desired State Configuration (DSC) in PowerShell 4.0. VTC is a South Asia MVP community initiative to bring you up-to the speed on latest Microsoft technologies. This event is being hosted by South Asia MVP team and they have a very interesting line-up of speakers and topics in this event. This includes two parallel tracks – developer and IT Pro.

Retrieve list of VMs excluded from SCVMM PRO/Dynamic Optimization

We can exclude VMs from SCVMM Performance and Resource Optimization (PRO) or Dynamic Optimization (DO). This is done at a VM level and there is no central place to see what all VMs are excluded from optimization. PowerShell to the rescue, of course. The Get-VM cmdlet in SCVMM module has a property called ExcludeFromPRO which tells us if a VM is excluded from PRO or DO. So, this is quite simple.

I will publish another post to show you where exactly this comes handy. Watch this space.

PoshUtils: Retrieve Cluster Shared Volume (CSV) to physical disk mapping

Last week, I was looking for a way to retrieve the Clustered Shared Volume (CSV) to physical disk mapping on Windows Server 2012 using PowerShell. I have seen some scripts elsewhere that use DiskSignature to get this mapping using WMI. However, I wasn’t able to follow the same approach as the disk signature for some of the volumes I am using turned out to be 0x0 for some reason. So, I started looking at an alternate approach and figured that I could use the volume path as the key. So, I started wrapping that code in a function and this is what I ended up with.

The code is self-explanatory. Since I am using the Windows Server 2012 storage cmdlets, this will work only on Windows Server 2012 systems and that is all I tested also. Here is how you can use this function

And, this is what you will see. Hope this is helpful.

PowerShell Bangalore User Group Meeting – June, 2013

PowerShell Bangalore User Group (@PSBUG) is meeting on June 1st, 2013. From this event onwards, we are moving into a new format of having sessions not longer than 30 minutes and having multiple speakers from the community. In this upcoming meeting, we have four sessions on using PowerShell. Agenda: 10AM to 10.15AM – Registrations at the venue 10.30AM to 11.00AM – PowerShell for Hyper-V administration, Vinith Menon 11.00AM to 11.30AM – PowerShell for SQL Server Administration, Ravikanth Chaganti 11.30AM to 11.45AM – Break 11.45AM to 12.15 PM – PowerShell for SharePoint Server Administration, Kamlesh Rao 12.15PM to 12.45PM – Using regular expressions in PowerShell, Deepak Dhami 12.45PM to 1PM – Q & A and Open House Venue: Microsoft MTC 4th Floor, Hamilton Hall Signature Building Embassy Golf Links Business Park, 560071 Registration is free: http://psbugjune12013.eventbrite.com/

Bangalore PowerShell User Group Meet on April 6th 2013

The Bangalore PowerShell User Group (@PSBug) is meeting on April 6th 2013. There are some very exciting topics lined up for you by the community and I am really looking forward to this meet. Here are the topics that will be discussed: 1. PowerShell for Exchange by Sahal Omer2. PowerShell for Citrix by Harshul Patel3. PowerShell for Post-Exploitation by Deepak Dhami The venue is Dell International Services, Intermediate Ring Road, Domlur, Bangalore. You can register for this event here.

Set (or inject) guest network configuration from Hyper-V host (Windows Server 2012)

Those of you who work(ed) on VMware ESX and use PowerCLI for ESX management would have – at some point in time – used the Set-VMGuestNetworkInterface cmdlet to set the IP address configuration of guest OS from the vCenter host or where you have PowerCLI installed. This is quite useful when performing automated guest OS installs and you want to be able to accurately set IP information for different network interfaces in the guest. In Hyper-V in Server 2008 R2, there were no interfaces to achieve something like this. However, as I’d mentioned in an earlier post, the updated WMI namespace in Hyper-V in Server 2012 provides a way to set the guest IP information from Hyper-V host. In a previous post, I showed you how to retrieve Hyper-V guest network configuration information using the updated WMI classes. In this post, we shall see how we can set the guest network information. We will use the new WMI class in Server 2012 Hyper-V WMI namespace – Msvm_GuestNetworkAdapterConfiguration. Make a note that this works only when …

Get Hyper-V (Windows Server 2012) guest network configuration using WMI

If you have not seen this yet, the updated WMI namespace for Hyper-V role in Windows Server 2012 has some hidden gems. I love playing around with WMI and the changes in Hyper-V namespace had me thinking about new possibilities. Here is the first one in this series of posts on how you can extend Hyper-V management beyond what is available in the Hyper-V PowerShell module. In this post, I will show you a simple function to get the guest network configuration details using WMI. We use the Msvm_GuestNetworkAdapterConfiguration WMI class to achieve this.

In the above function, we are making use of the updated virtualization namespace root\virtualization\v2. In this function, we first get the virtual machine object:

Once we have the VM object, we retrieve the VM setting data which includes information on how many synthetic network adapters are attached, etc.

Since the above command gives us entire VM setting data and we are interested only in the synthetic adapter data, we filter this further to get only the synthetic adapters attached …