Adam Bertram` avatar

Building PowerShell Scripts to Tie Disparate Products Together

23 hours ago | Adam Bertram`

The PowerShell scripting language has been called “automation glue” more times than I can count. It’s a fitting description if you’ve worked with it a lot. You may get the automation part of the title right away if you’ve merely heard of PowerShell and what it can do but the “glue” part may leave you wondering why. PowerShell was born at [...] The post Building PowerShell Scripts to Tie Disparate Products Together appeared first on Adam, the Automator.

Adam Bertram` avatar

Clear Cached Credentials With the cmdkey and PowerShell

yesterday | Adam Bertram`

Cached credentials make users’ lives easier, but they can be a security issue in Windows if a device falls into the wrong hands. IT can manage them on a large scale with PowerShell. Users like cached credentials because they are convenient and keep them from having to type in their login information every time they access their devices. For IT, [...] The post Clear Cached Credentials With the cmdkey and PowerShell appeared first on Adam, the Automator.

Jaap Brasser avatar

EIC Inspiration Night – Chat Ops session

2 days ago | Jaap Brasser

Tonight I was invited to speak at the EIC Inspiration event, located in Groningen. It was my first time attending, and as a result, speaking at this event. If you living in the neighborhood or if you are interested in the events they host have a look over here: IEC Inspiration There was a photographer […]

Alex Neihaus avatar

An open letter to the PowerShell team

2 days ago | Alex Neihaus

PowerShell 6's time has come

Adam Bertram` avatar

Creating a Timeout Feature in Your PowerShell Scripts

2 days ago | Adam Bertram`

Don’t let your entire workflow be hung up because one of the scripts is stuck on some task. There’s a way around that! Have you ever written an excellent PowerShell script only to find that it just hangs on some task without any indication why? It’s especially frustrating if the script is being kicked off by an unattended process. The [...] The post Creating a Timeout Feature in Your PowerShell Scripts appeared first on Adam, the Automator.

Adam Bertram` avatar

How to Accurately Enumerate Windows User Profiles With PowerShell

2 days ago | Adam Bertram`

When trying to enumerate all profiles, you need a script that can account for a variety of scenarios. An everyday task that many admins must perform when working with both Windows server and client operating systems is listing all user profiles. A user’s profile is the usual place that every installed application, as well as Windows itself, places files and [...] The post How to Accurately Enumerate Windows User Profiles With PowerShell appeared first on Adam, the Automator.

Dynamically Create Pester Tests For PowerShell

2 days ago | Thomas Rayner

The Pester people don’t really recommend this, but, I find it can be really helpful sometimes. What I’m talking about is dynamically creating assertions inside of a Pester test using PowerShell. While I think you should striveRead More...

Adam Bertram` avatar

Know How to Build a Logging Function in PowerShell

3 days ago | Adam Bertram`

Keeping tabs on what a script is doing is critical for monitoring and debugging. Monitoring a script can be done in many different ways, but it is usually dependent on how it’s being executed. If a script is invoked interactively, meaning directly from the console using techniques such as Write-Verbose, Write-Information or Write-Host, it is useful because each command can display messages on the console [.

Jaap Brasser avatar

Dutch PowerShell User Group – Basics part Deux

3 days ago | Jaap Brasser

It had already been well over a year since the first iteration of the DuPSUG Basics day, but yesterday we finally had the opportunity to host our second day of basic PowerShell training. This time we were hosted at the Sogeti office in Vianen. BEGIN END SPEAKER TITLE 09:15 10:30 Mark van de Waarsenburg Powershell […]

Adam Bertram` avatar

Learn to Code or Else: An Information Technology Professional’s Guide

3 days ago | Adam Bertram`

System administrators and developers must come to the table and learn each other’s jobs, or they may find themselves without a job. Are you manually creating new virtual machines? Are you going into the Active Directory Users and Computers tool and creating, modifying or resetting passwords? If so, you may be looking for a new job in 5 years. In [...] The post Learn to Code or Else: An Information Technology Professional’s Guide appeared first on Adam, the Automator.

Josh Duffney avatar

Getting Started with Invoke-Build

3 days ago | Josh Duffney

Table of Contents Table of Contents What is InvokeBuild? PowerShell Module Development Workflow Creating The InvokeBuild Script Creating the Install Dependencies InvokeBuild Task Adding Linting with PSScriptAnalyzer Testing the Code with Pester Updating the Module Manifest Generating an Artifact Sources What is InvokeBuild? Invoke-Build is a build automation tool written in PowerShell.

Jaap Brasser avatar

Austin PowerShell Users Group – Slides and Code

3 days ago | Jaap Brasser

Last week I had the pleasure of presenting for the Austin PowerShell UG, this is a group run by Ricc Babbitt. During this session I presented the following topic: Reach the next level with PowerShell During this presentation I walked the audience through the process of developing a short script to gather information from a system. […]

Mike Robbins avatar

Detect the presence of and remove CCleaner with PowerShell

3 days ago | Mike Robbins

Based on the news today, I thought I would share a couple of PowerShell code snippets to detect the presence of and silently uninstall CCleaner. You can detect the presence of CCleaner along with the version of it you have installed via the registry. You can use a similar command to run its uninstaller silently if it’s detected. Give it a couple of minutes and then run the first command again to verify it has been removed.

Adam Bertram` avatar

Here’s How to Create PowerShell Functions for the Pipeline

3 days ago | Adam Bertram`

By purposefully building PowerShell functions for the purpose of using the Pipeline, our functions can interact with each other in an easy to understand manner. PowerShell allows you to create functions that have a number of different purposes. Functions allow the scripter to combine like-code into building blocks which can then be used to build even larger functions or scripts. [...] The post Here’s How to Create PowerShell Functions for the Pipeline appeared first on Adam, the Automator.

Adam Bertram` avatar

Find Out How to Build Your First PowerShell Module

4 days ago | Adam Bertram`

Are you constantly trying to find that script you know you wrote months ago but can’t find it? You need to build modules. Do you have a bunch of PowerShell scripts in a folder somewhere called Scripts? Are a bunch of those scripts all related like SQL, Active Directory, some private business process, etc.? Are you constantly trying to find [...] The post Find Out How to Build Your First PowerShell Module appeared first on Adam, the Automator.

Sergey Vasin avatar

Primary Group в Active Directory

4 days ago | Sergey Vasin

Когда мы хотим получить информацию о членстве в группах определенного пользователя или компьютера, мы можем воспользоваться командлетами Get-ADPrincipalGroupMembership или Get-ADAccountAuthorizationGroup. Первый из них выведет информацию обо всех группах, в которые объект входит непосредственно. Результат выполнения второго командлета будет содержать все группы, в которые объект входит как явно, так и через другие группы.

Sergey Vasin avatar

Вложенные группы Active Directory и PowerShell

7 days ago | Sergey Vasin

Группы Active Directory используются для множества разных целей, будь то фильтрация групповой политики или назначение определенных привилегий пользователям. Достаточно гибкая структура позволяет разграничивать объекты пользователей и компьютеров наиболее удобным для нас образом. Но в то же время это приводит к образованию иерархии групп, состоящей из нескольких уровней (что, в общем то, нормально)

Adam Bertram` avatar

Measure Objects in PowerShell with the Measure-Object cmdlet

7 days ago | Adam Bertram`

According to the help content, Measure-Object ‘calculates the numeric properties of objects, and the characters, words, and lines in string objects, such as files of text.’ This is a vague description of what this command can do, so let’s dive into that and go over a few contexts where using the Measure-Object command might make sense. Peter Drucker, a legendary [...] The post Measure Objects in PowerShell with the Measure-Object cmdlet appeared first on Adam, the Automator.

Adam Bertram` avatar

Reboot with the Restart-Computer PowerShell cmdlet

8 days ago | Adam Bertram`

The Restart-Computer PowerShell cmdlet lets you reboot multiple computers in the console or in your scripts. Learn about all the options in this article. Rebooting a Windows computer is easy, right? We click the Start button and click Restart, and it just does it. This is fine for your computer at home, but what about doing this at work where [...] The post Reboot with the Restart-Computer PowerShell cmdlet appeared first on Adam, the Automator.

Mike Robbins avatar

PowerShell Version 2 Compatible Function to Determine Windows Firewall State

8 days ago | Mike Robbins

I recently had a need to perform some security auditing on an environment that still has some servers running PowerShell version 2 (PowerShell version 2 is deprecated). One of the things I needed to determine was whether or not the Windows firewall was enabled on each of the servers in the environment. Luckily, all of the servers at least had PowerShell remoting enabled. The PowerShell function shown in the previous code example is a wrapper for the Netsh.

Jeff Hicks avatar

PowerShell Pop Quiz

9 days ago | Jeff Hicks

I’m always looking for ways to help teach PowerShell and the other day I thought why not have PowerShell teach you itself? I have created a PowerShell script that dynamically generates a quiz on cmdlets and functions installed on your computer. In short the quiz question shows you a command synopsis and then presents a […]

Piping PowerShell Output Into Bash

9 days ago | Thomas Rayner

With Windows 10, you can install Bash on Windows. Cool, right? Having Bash on Windows goes a long way towards making Windows a more developer-friendly environment and opens a ton of doors. The one I’m goingRead More...

Sergey Vasin avatar

Изменение значений атрибутов Active Directory, представленных битовыми масками

10 days ago | Sergey Vasin

Вслед предыдущей статье, где мы рассматривали способы фильтрации с использованием значений флагов в атрибутах, представленных в виде битовых масок, давайте поговорим о подходах к изменению значений таких атрибутов. В атрибутах такого типа каждый бит является отдельным флагом и имеет свое собственное значение. Примерами таких атрибутов являются UserAccountControl для объектов пользователей и компью

#TSQL2sDay Long Story Short: Avoid -Scope User

10 days ago | Aaron Nelson

For T-SQL Tuesday #94 the topic is databases and PowerShell. Rob Sewell asks us: What are you going to automate today? I’m going to automate some thing in SSRS & SSAS, but that’s not...

Jaap Brasser avatar

Updated Events GitHub repository – Convert pptx to pdf

10 days ago | Jaap Brasser

As I have been speaking at a number of events recently I also have been updating my GitHub Events repository. Usually I include a markdown file with a short description, my demos and my slides. I had been uploading my files as .pptx and I noticed that the repository edged over 100 MB. This prompted […]

Mateusz Czerniawski avatar

LAPS deployment

11 days ago | Mateusz Czerniawski

What is LAPS and why I need it In windows domain based environments accounts with domain admin rights should be protected by all means. We all know that those accounts have the greatest privileges in the domain. There are other accounts that should be kept secure as well. Sean Metcalf has a great article about … Continue reading LAPS deployment

Sergey Vasin avatar

-band, -bor и их LDAP-аналоги

11 days ago | Sergey Vasin

Как мы знаем, многие атрибуты объектов Active Directory представлены в виде битовых масок. Например, такие как UserAccountControl для объектов пользователя или компьютера или GroupType для объекта группы. И хотя командлеты модуля ActiveDirectory представляют эти значения в виде отдельных атрибутов, скрывая от пользователя их истинную природу, иногда нам все-таки приходится работать с ними напрямую.

Sergey Vasin avatar

Использование методов ConvertToDateTime и ConvertFromDateTime объектов WMI

14 days ago | Sergey Vasin

В продолжение предыдущей темы о конвертации значений даты и времени, в этот раз поговорим об объектах WMI. Для получения экземпляров объектов WMI нам доступны несколько способов. Один из них — это использование командлетов модуля CIMCmdlets. Например, так: Теперь, если мы посмотрим на значение свойства LastBootUpTime, мы увидим, что оно вполне себе похоже на объект DateTime. […]

Jaap Brasser avatar

Decipher obfuscated URLs with PowerShell

14 days ago | Jaap Brasser

I recently received a message on Skype from a friend I had not talked to for a while, I was happy to see it was spam. Not because it was spam, but because it was using an encoded Url. After taking a quick look at the structure I thought, this is definitely something I can […]

Prateek Singh avatar

Scrolling Internet Explorer with Powershell

15 days ago | Prateek Singh

My top preference for data munging and harvesting from The Web is Internet Explorer, Yes, Internet Explorer! 🙂 because I can create an InternetExplorer.Application object and access the HTML DOM to scrape web data as and when required. The problem arises when all information on the web page is not populated by default when the page loads,… Read More Scrolling Internet Explorer with Pow

Mike Robbins avatar

Remotely cleanup log and temp files from your Windows based servers with PowerShell

15 days ago | Mike Robbins

Setting up a scheduled task or job on individual servers to cleanup log and temp files just doesn’t scale very well because you have scheduled tasks or jobs setup on lots of individual servers that need to be maintained. Today it’s this server and tomorrow it’s two or three more. It’s much easier to setup one scheduled task or job on a server that’s designed for management to remotely cleanup the desired files on all of your servers.

Sergey Vasin avatar

Получение значения атрибута pwdLastSet объекта пользователя при запросе к Active Directory с использованием LDAP

15 days ago | Sergey Vasin

Скажем сразу — все, что здесь описано касается также и остальных атрибутов, содержащих значение даты и времени. Тем не менее в этой статье мы будем говорить об атрибуте pwdLastSet, а применить описанные подходы к другим атрибутам вы сможете и сами. Когда для запросов к Active Directory мы используем командлеты одноименного модуля, то результаты их выполнения […]

Alex Neihaus avatar

Use regex to validate PowerShell parameters

15 days ago | Alex Neihaus

Using regex with ValidatePattern

How To List All The Shares On A Server Using PowerShell

16 days ago | Thomas Rayner

There’s a few ways to get all of the shared folders on a server, but not all of them work for all versions of Windows Server. You can use the Get-SmbShare cmdlet, or you can make CIM/WMIRead More...

Sergey Vasin avatar

ConvertFrom-sthSID — функция для конвертации строки SID в формат массива байтов

16 days ago | Sergey Vasin

В предыдущей статье мы говорили о преобразовании SID из массива байтов в строчный формат. Почему бы нам не написать функцию для обратного преобразования. Назовем ее ConvertFrom-sthSID. Начнем с определения параметра. В качестве его имени мы выберем SID, его использование будет обязательным, и, так же как и в предыдущем случае, мы не будем против если пользователи […]

Sergey Vasin avatar

ConvertTo-sthSID — функция для конвертации SID в виде массива байтов в строчный формат

17 days ago | Sergey Vasin

Работать с Active Directory из PowerShell гораздо удобнее с использованием командлетов из одноименного модуля. Однако, если на каком-либо компьютере этот модуль не установлен и PowerShell Remoting нам в данный момент по каким-то причинам недоступен, мы можем использовать ADSI — Active Directory Service Interfaces. Когда мы обращаемся к Active Directory при помощи ADSI, например, так большинс

Prateek Singh avatar

Plot Graph in Powershell console

18 days ago | Prateek Singh

* Color-coded output depending upon the Value of the Datapoint; Above or below predefined thresholds * Display custom information on X and Y-Axis labels * A Graph in the console that is independent and fully customizable, not like Task Manager’s (no need to switch to Performance Tab) and, * Could be easily used in any Powershell script to monitor performance on any defined parameter, which I see as the biggest benefit of the function.

Jaap Brasser avatar

Wrapup of BSides Amsterdam 2017

18 days ago | Jaap Brasser

Last Friday I had the pleasure to speak at BSides Amsterdam, a security centered conference that hosted its first iteration in Amsterdam. I could not pass up on the opportunity to attend this event. Here is an excerpt about the BSides concept from their site at bsidesams.nl: Security BSides is a community-driven framework for building events, […]

Josh Duffney avatar

Using Module Versions with Invoke-DscResource

20 days ago | Josh Duffney

Invoke-DscResource is a cmdlet available in PowerShell version 5 and above. It allows you to run a Dsc resource method without having to generate a mof document or even write a configuration document. In this blog post you’ll learn how to use a ModuleSpecification to tell the cmdlet which version of a resource module to use. Why would you need to do that? By default, the cmdlet will use the latest version of the resource called which might not be what you want.

Mike Robbins avatar

Using Out-GridView to simplify selecting the region when managing Microsoft Azure with PowerShell

22 days ago | Mike Robbins

You’ve signed up for a Microsoft Azure account and you’ve installed the Azure Resource Manager PowerShell cmdlets on your computer. You login to Azure from PowerShell. You’ll normally see most people use Login-AzureRmAccount, but that command is an alias (Login isn’t an approved verb). Login to Azure and provide the account login information when prompted: Several of the cmdlets in the Azure Resource Manager PowerShell module require a location (a region) to be specified when creating things.

David Christian avatar

Module Tools - Starting Off

22 days ago | David Christian

This is going to be the first in a series of posts related to working with module tools. In my previous article, I talked about what tools module authors should leverage. Now I want to walk through using these tools and demonstrate how they all come together. To do this, we will be creating a new module called HideWindowsExplorerDrives. The purpose of this module is to make hiding and showing explorer drives easier.

Get A ServiceNow User Using PowerShell

23 days ago | Thomas Rayner

ServiceNow is a cloud computing company whose software is used for IT Service Management based on ITIL standards. They’ve got a bunch of different modules for managing problems and incidents, operations management, performance analytics, and more.Read More...

Jeff Hicks avatar

Get Git with PowerShell

28 days ago | Jeff Hicks

If you are creating PowerShell scripts, tools or modules today, you are most likely using Git. What? You’re not? Is it because you haven’t gotten around to installing it? I have some “quick and dirty” PowerShell hacks to help you out on Windows systems. Linux boys and girls already know what to do. Naturally you […]

Jan Egil Ring avatar

Announcing the PowerShell Productivity Tools module

28 days ago | Jan Egil Ring

In this article, we are going to introduce a new PowerShell module called PSProductivityTools. Time management Time management is something most people is having to face every day. At work, we try to be as productive as possible. However, it may not be easy due to many distractions during a work day. Many books are written on this topic, and several techniques exists for trying to put your available time into a system.

Jeff Hicks avatar

Enhancing PSVersionTable

29 days ago | Jeff Hicks

Not too long ago I posted a PowerShell function that could provide detail abut the PowerShell engine driving your current PowerShell session. I like having a function that writes an object to the pipeline, can take parameters and offer help documentation. But there’s an alternative approach you could also take. Most of the information is […]

Prateek Singh avatar

Get-Weather report using Powershell

29 days ago | Prateek Singh

I came across some fun stuff on the internet, so I wrapped it inside a Powershell Function for this blog post. The idea is to get weather report in Powershell console using this  cURL implementation converted into Powershell function below Just pass a name of the City as a parameter to the Function to get… Read More Get-Weather report using Powershell

Mike Robbins avatar

How to install Visual Studio Code and configure it as a replacement for the PowerShell ISE

29 days ago | Mike Robbins

If you follow me on Twitter, then I’m sure you’re aware that I’ve been using nothing but VS Code (Visual Studio Code) as a replacement for the PowerShell ISE (Integrated Scripting Environment) for the past couple of weeks and while I had tried it in the past, I didn’t previously think it was ready for prime time. That’s now changed with all of the updates and work that has gone into it.

I’m Speaking at Ignite in Orlando!

one month ago | Aaron Nelson

I’m excited to say that I will be speaking at Ignite this year in Orlando! I was at Ignite in Atlanta last year and it was an excellent experience. I’m really looking forward to...

Prateek Singh avatar

Expand Short URL using Powershell

one month ago | Prateek Singh

Introduction: A couple of URL shortening services like Google and TinyURL are available over the Internet, and I’m a big fan as Short or Tiny URLs as they are very useful to share contents on social media (Eg. Twitter with 140 Char limit), especially for bloggers,  but they can be used for malicious purposes by… Read More Expand Short URL using Powershell

Josh Duffney avatar

Getting Started with Pester

one month ago | Josh Duffney

Pester is a PowerShell behavior-driven development (BDD) style testing framework. But, really all you need to know about it before getting started, is that it’s a testing framework and it can be used to automate the testing of your PowerShell code. You might think to yourself well what’s the point of that? I already wrote my PowerShell function, all I need to do now is run it and see if it does what I want.