Skip to main content

Posts

Showing posts from 2014

PowerShell + Exchange : Checkbox of Doom

Many of the Exchange Admins might already be familiar with the dreaded checkbox of doom , which causes issues with move request and Mobile devices. Post by MVP Tony Redmond here  explains this in detail. Scenario & the Problem at hand : When a User connects to the Exchange Server using his Mobile device, then after the authentication the Exchange Trusted Subsystem creates  msExchActiveSyncDevices Objects for the User. This will be evident from the below screenshot for one of the User in ADSI edit. Now what if the Exchange Trusted Subsystem doesn't have permissions on the AD User to create those Objects , all hell is let loose. This was the case I was tackling recently and searching each User in the Directory which had this checkbox of doom unchecked manually is not feasible (am lazy).

PowerShell + Azure + Exchange : Connect Mobile devices

As already mentioned in my previous post , I now have a test Exchange 2010 Server running on Azure . Now working in Mobile Device & Email Management space, my mobile devices needed to eventually connect to my Email Infrastructure to try out few scenarios. Initially I thought that opening the https endpoint and enabling ActiveSync (for the Mailbox User) would suffice, but I was wrong. Needed to make few changes to the SSL bindings on the IIS and trust the certificate used for the same. Let's get to it then. When we create a new VM on Azure it gets the Certificate for the cloud service added to the machine's personal Cert store. Below is a screenshot showing the same : Now as mentioned in my previous post Exchange by default will create a self signed Certificate and bind it to the CAS Server for https communication.

PowerShell : Play Music until Sleep

A while back I had blogged about using PowerShell to create a playlist of random songs in VLC player & I had a rudimentary function based on that in my profile. 001 002 003 004 005 006 function   play-song {      param ( [int] $count = 5 ,   [string] $Path = "D:\Songs" )      Get-ChildItem   $Path   -recurse   -filter   *.mp3 |   Get-Random   -Count   $count   |          ForEach-Object   -process  {  Start-Process   $_ . Fullname  -verb   'AddtoPlaylistVLC' } } I know the name contains an unapproved verb but I was lazy to change it. Few days back I thought of extending above function a little bit, so that my laptop Sleeps when the songs in the playlist end (hopefully I would have slept by that time )

PowerShell + Azure + Exchange - Connect Remotely

My recent dive into the Mobile Device & Email Management space has presented me with an opportunity to learn Exchange & Office 365. I have built up an Azure VM running Server 2008 R2 with Exchange 2010 Server on it. It didn't made a whole lot of sense to connect to the machine using RDP and then running cmdlets on Exchange Management Shell. Well I must admit that I tried opening a normal PSSession and importing the Exchange cmdlets in there but that didn't work as the Microsoft.Exchange endpoint configuration is hosted on IIS. So here are the steps I followed to get the Exchange cmldets via Implicit Remoting, this is very similar to what we do with Office 365. This is a beginner post as am still wrapping my head around Exchange ;) Open the endpoint on the cloud service to allow the HTTPS traffic to your Exchange Server. Here is how the endpoints appear for my Exchange box. Note that the Public and Private port are both 443 which means when I try reach my c

PowerShell + Azure Automation : Unleash the Automation Cmdlets

In my previous post, I blogged about using Azure Automation to deploy a Windows 10  Server Technical Preview VM in my test domain running on Azure. But if you noticed there were lot of things that we needed to do from the Azure portal. Being an advocate of doing all things from PowerShell I gave it another shot and below is what I found (notice the colors based on what I was able to do with PowerShell)  : 1. Get the Ground work ready (few bits possible ) 2. Create the Assets  (not possible at the moment) 3. Create a RunBook to deploy the VM (and add it to the domain) (PowerShell Rocks !) PowerShell + Get the Ground work ready As already mentioned at the moment you can't create an Azure Automation account with PowerShell, but what you can do is add a new User to Azure Active directory :) You will have to review Software Requirements and then  install the Azure AD module   Once the module named " Msonline " is installed you can very well go ahead and c

PowerShell + Azure Automation : Deploy a Windows 10 VM (Server Tech Preview) & domain join

Recently VM running Server Technical Preview were added Azure Gallery and I thought of deploying a VM running it joined to my test domain (see my post on using PowerShell to deploy a DC on Azure ), But I wanted to do that using Azure Automation. Azure Automation is a highly scalable workflow engine offering where we can have Runbooks (PowerShell workflows) to automate long running , error prone tasks. I first saw this in action at one of the sessions by Ravi Sir [PowerShell MVP] at one of the PowerShell Bangalore User Group meet where he used Runbooks to demonstrate really cool stuff. Note - Azure Automation is still in preview so you might have to sign up for it by navigating to  https://account.windowsazure.com/PreviewFeatures Divided the post into 3 steps: 1. Get the Ground work ready 2. Create the Assets 3. Create a RunBook to deploy the VM (and add it to the domain) Get the Ground work ready First of all create an Azure Automation account from the portal (no Po

PowerShell + SCCM - POSH Deploy v1

I wrote an article for the coveted PowerShell Magazine on how to automate query based deployments in ConfigMgr using PowerShell. http://www.powershellmagazine.com/2014/07/22/automating-deployments-in-configuration-manager-with-powershell/ If you go through that article you will get a background of this post. So continuing to that, I present " POSH Deploy v1 " which can be used to automate Query Based deployments with Configuration Manager (tested it on CM 2012 only). I had a similar tool built in my previous project for SCCM 2007 but that one had a lot of hard coded values, tried to remove those. The tool earlier used Winforms and this time I kicked myself to try out WPF with PowerShell . Thanks to StackOverflow and blog posts shared around these topics by awesome community people :)

PowerShell + WPF + GUI : Hide (Use) background PowerShell Console

Few years back, I had started wrapping my PowerShell scripts with some sort of GUI built using Windows Forms (used Primal Forms CE mostly). Things went fine for a while but then I stumbled across awesome posts by MVP Boe Prox on using WPF with PowerShell to do the same. (check Resources section) I had been procrastinating the idea of playing with WPF for a while but then had a great discussion with MVP Chendrayan (Chen) and got inspired to do it. One can use Visual Studio (Express Edition - which is free) to design the UI and then consume the XAML in PowerShell script...Isn't that Cool ! See resources section for links on that. Often when we write the Code to present a nice UI to the end user there is a PowerShell console running in the background. In this post I would like to share a trick to hide/show the background console window. This trick works with both Winforms and XAML. Note - PowerGUI & Visual Studio Express are absolutely FREE ! For the demo of thi

PowerShell + Azure : Deploy a DC

Recently my laptop got stolen and that gave me a push to build my lab on Azure. I tweeted this and got an awesome reply by Jim Christopher [PowerShell MVP] : Thanks to my friend Fenil Shah who lend me his laptop to try out Azure. Cheers to having awesome friends :) I thought it would be better if I put my notes as a post. These are entirely for my reference ;)  The best posts around Azure + PowerShell are by Michael Washam which can be found on his blog  here . My Action plan is to configure a ServerCore Server 2012 R2 machine running Active Directory for this post from scratch, I don't have anything right now on my azure account. Below are the steps: Sign Up for Azure (Free Trial is available) Install Azure PowerShell Module &  Configure your subscription Create a Virtual Net for your LAB Deploy the VM Connecting to VM using PSRemoting Add a new Data Disk to VM Install ADDS and a new domain. Steps 1-3 are one time activity, next time you want t