Security Focus: Defending PowerShell with the Anti-Malware Scan Interface (AMSI)

Naturally, I was intrigued when I heard that some new anti-virus and anti-malware capabilities were coming to PowerShell in the form of…   The Anti-Malware Scan Interface As we know, PowerShell is an incredibly powerful administration and automation tool, but that same power can be wielded by the bad guys. In fact, PowerShell has proved to be a popular propagation…

1

MOTD

Once upon a time I was a *nix administrator and I used to make use of Message Of The Day (MOTD) files to communicate with users at logon time. These messages would appear prior to the logon prompt blinking. All you'd have to do is place your message in /etc/motd and the *nix system would take care of the rest….

0

Create a CSV Report of DHCP Scope Options

You're running Windows Server 2012 DHCP. Alternatively, you might be running Windows Server 2012 R2 DHCP. Whatever the flavour, the point is this – you have DHCP cmdlets at your disposal! Oorah! Now, you also have a lot of scopes and you also have a lot of scopes with there very own scope options. You…

9

Backwards Incompatibility: Slip Into Something Just As Comfortable

PowerShell is designed to be backwards compatible. However, there are some things that you can do in v3 and above that just don't work in v2. This is deliberate. And, there's often the need to write code for systems running v2. So, even in Windows 10, which ships with v5, we give you the ability to drop…

1

Create Azure Cloud Service Remote Desktop Connection Manager File (.rdg)

Last week I launched an RDP session to an Azure VM with the aid of a PowerShell cmdlet. For me, this is much easier than finding the required RDP link in one of the the Azure portals and I've been using the PowerShell method for a while. Now, in writing last week's post I thought to myself, "How could I make my…

2

One-Liner: Launch Azure VM RDP Connection from PowerShell

You want to RDP to one of your Azure VMs, but… Are you fed up with finding the target VM in the Azure portal? Are you running out of space to pin VMs to the portal home page? If so, here's another one-liner I use all the time. This one RDP's to one of my Azure VMs… Get-AzureRemoteDesktopFile -Name TheBTeamDC01 -ServiceName TheBTeam…

1

Scripting Tips & Tricks: ISE – Alt + Shift + Left Mouse Button

Here's a very useful one shown to me by one of my Dutch colleagues, Stefan Stranger. I keep using this over and over, so it's going to be of value to others.   Problem You've got a block of code in your ISE that you've tabbed / indented across too much. Eh? Look at this:  …

3

Update an ISE Snippet

Snippets. Little script blocks that save time when crafting a script with the Integrated Scripting Environment (ISE). Now, if, like me, you've used the New-IseSnippet cmdlet to create your own snippets, then, also like me, you may need to update one of those snippets from time to time.   How to update? Well, first you'll need…

0

Scripting Tips & Tricks: The PowerShell Script Analyzer Module

I love this new module. It makes adhering to scripting recommended practices an absolute doddle. And there's no need to go and download it from a repository as it comes bundled with v5!   Unleash the Beast Let's have a look at the cmdlets that  come with the psscriptanalyzer module:   Now, run Invoke-ScriptAnalyzer against one of my more…

2

Quenching a Thirst… Test Lab Hydration

Tenuous title link aside, here's a collection of scripts and steps that will help you hydrate a test lab. The scripts are designed to mirror an exiting environment.   Plant Your Forest If you have the luxury of an Azure subscription take a look at the below forest build script. It will allow you to add member servers and clients,…

2