Categorie archieven: PowerShell

Starting PowerShell as default within Windows Core

My lab environment runs on Windows 2012 R2 Core, with Hyper-V installed. It runs smoothly. When I need to manage the environment I can do the most common task right there on the prompt.

But with Microsoft pushing everyone to use PowerShell I don’t understand why Windows Core start with a normal prompt instead of a PowerShell prompt.

In this article I will describe how you can change the prompt that is launched when Windows Core boots from CMD to PowerShell.

In Windows Core there is no explore. All you get to see is al black command box..

Schermafdruk 2014-08-11 20.53.59

Now let’s see if we can find out how to change the cmd prompt to a PowerShell prompt.
First I need to know what’s the current value for the shell that is launched at startup.

Lees verder Starting PowerShell as default within Windows Core

Remote manage a SQL environment with PowerShell

downloadIn this article I want to talk about managing a SQL 2012 Server with PowerShell from a remote computer. As I’ve mentioned in an earlier blog post PowerShell is becoming more and more important in the day to day task of a system administrator.

I am using PowerShell ISE as scripting application. It is a simple scripting tool but it does everything I need at this time to make my PowerShell work easy.

 

$fldr = "C:\users\robin\Documents\PowerShell\data"
$credential = Get-Credential
 
$credential.Password | ConvertFrom-SecureString | Set-Content "$fldr\adminpassword.bin"
 
$password = Get-Content "$fldr\adminpassword.bin" | ConvertTo-SecureString
 
$cred = New-Object System.Management.Automation.PSCredential("contoso\adminrobin", $password)
 
New-PSSession -Name SQL -ComputerName sql01.contoso.com -Credential $cred
 
Enter-PSSession -Name SQL

Lees verder Remote manage a SQL environment with PowerShell

Enabling Remote Desktop remotely with PowerShell

downloadLast week I was busy building a new lab environment on my Hyper-V environment. My automated installation joined the machine to my LAB environment domain and disable the Windows Firewall. The only thing I forgot to include was enabling Remote Desktop. It was not posible to start a remote registry session, and I did not have my machine running that has the Hyper-V Manager installed.
The solution is to open a remote PowerShell sessie via the ServerManager.

Lees verder Enabling Remote Desktop remotely with PowerShell

Create a PowerShell Profile ready for XenDesktop Management

PowerShell_Logo Today I want to show you how to create a PowerShell instance that is all ready for managing a Citrix XenDesktop 7.1 environment.

We’ve all been there you want to check something quickly in your environment. You start up PowerShell, enter a command and you are presented with an error message that the command you just entered is not recognized by PowerShell.

Screenshot 2014-05-06 21.34.56

We get this error message not because of a typo but because the Citrix Snap-ins are not loaded in this PowerShell session.

Lees verder Create a PowerShell Profile ready for XenDesktop Management