Tag Archives: Scripting

AZPSUG - Arizona PowerShell user group

Arizona PowerShell User Group – From PowerShell Function to Serverless code with Azure Functions

Yesterday I was asked to speak at the Arizona PowerShell User Group, I picked the subject of moving your code into Azure Functions. Although PowerShell might not seem like the obvious choice, there are some definite benefits to be had from having a subset of your code run in Azure Functions. Providing you with the benefits of serverless, no operational management and almost infinite scalability.

This was not the first time for me to speak at the Arizona PowerShell user group as I already spoke there, also remotely, in March this year. The topic back then was: Fun with PowerShell 6 – JEA Remoting and cross-platform.

The code has been shared on GitHub in my Events repository:
Arizona PowerShell UG

I also shared the slides I used and my other presentations on SlideShare:

Share

New York PowerShell User Group – Microsoft Flow

At the end of May I will be speaking at the New York PowerShell User Group about using Microsoft Flow to automate your personal work at the Microsoft Offices in New York. If you are in the New York area and interested in Microsoft Flow, PowerShell or automation in general be sure to sign up and drop by on the 31st of May.

Microsoft Flow and PowerShell combined to automate everything – Jaap Brasser

Thursday, May 31, 2018, 7:00 PM

Microsoft
11 Times Sq New York, NY

48 PowerShellers Attending

Microsoft Flow is a great workflow automation tool, but most likely PowerShell is not the first thing that comes to mind when thinking about Flow. In this session I will show how to integrate Microsoft Flow in PowerShell scripts and vice-versa and to highlight the benefits that this provide. This demo-heavy session will feature a lot of PowerShell …

Check out this Meetup →

Share

Cloud Automation and PowerShell at UK User Groups

After a busy week at the PowerShell Conference Europe last week, blog post about this event is coming up soon! This week will be all about cloud based automation in both the form of Azure Functions as well as Microsoft Flow.

I will be speaking about this at the UK Cloud Infrastructure User GroupPowerShell Southampton, WinOpsPowerShell London UK and a collaboration between the Scottish PowerShell & DevOps User Group and the Glasgow SQL User Group.

Are you in the UK and are you interested in Cloud Automation using Microsoft Flow or Azure Functions? Then have a look at the following dates and places and sign up while the seats last:

If you cannot make it to any of the events, I will be sharing out the content presented. I look forward to meeting you there!

Share

Active Directory Friday: Find groups with no members

Occasionally groups may become obsolete or are never populated with members. It can be interesting to find out how many groups are in your organization that have no members, as action can be taken on it based on the output.

Overview of articles in this series
Active Directory Friday: Find groups with no members
Active Directory Friday: Principal group membership
Active Directory Friday: User account group membership

Because of the nature of how group membership is defined this article will be the first in a series of three. In this article I will show how group membership can be determined using an LDAP queries. The next article in this series will go into principal group membership and its implications and the final article will go into constructed attributes and how to work with constructed attributes, specifically the memberof attribute.

In this article I will give a a number of examples that can be used to determine which groups are empty. Using Get-ADGroup the following command can be executed to retrieve memberless groups:

Get-ADGroup -LDAPFilter '(!(member=*))'

Get-ADGroupNotMemberAnything

Alternatively the DirectoryServices.DirectorySearcher object can be used to achieve a similar result:

(New-Object DirectoryServices.DirectorySearcher -Property @{
 Filter = '(&(objectClass=group)(!(member=*)))'
 PageSize = 100
}).FindAll()

The [adsisearcher] type accelerator is another interesting alternative for this purpose, here is an example:

([adsisearcher]'(&(objectClass=group)(!(member=*)))').FindAll()

The problem with the above examples however, is that some groups will show up as being empty, for example the Domain Users group. Next week I will go into Principal group membership, what this is and how to query for this and by doing so generate more accurate results in regards to group membership.

For more information about the topics discussed in this article, please have a look at the following resources:

Active Directory Friday: Find groups with no members
Get-ADGroup
JaapBrasser.com – Active Directory Friday
Free ebook – Active Directory Friday All Articles
DirectoryServices.DirectorySearcher
Share

New script Remove-ScheduledTask in TechNet Script Gallery

One of the things that keeps me busy is maintaining the library of scripts I have made available in the TechNet Script Library. Earlier this week I noticed a request for my Get-ScheduledTask script, a script that gets a list containing the scheduled tasks from either the local machine or a remote system. The request stated if it was possible to create a function that could delete scheduled tasks.

Based on this question I had a look at the Get-ScheduledTask script and decided that it requried an additional property in the custom object that it outputs, the computer name. Using both the computer name and the path of a scheduled task I am able to delete scheduled tasks on both local systems as well as remotely.

Here is an example of Remove-ScheduledTask in combination with Get-ScheduledTask:

Get-ScheduledTask-Remove

.EXAMPLE
.\Get-ScheduledTask.ps1 | Where-Object {$_.State -eq 'Disabled'} | Remove-ScheduledTask -WhatIf

Description
-----------
Get-ScheduledTask will list all the disabled tasks on a system and the Remove-ScheduledTask function will list all the actions that could be taken

For more information or the direct download links of these scripts please refer to the links below. Feel free to leave a comment either here or in the TechNet Script Library.

TechNet Script Gallery
My entries in TechNet Script Gallery
Get-ScheduledTask
Remove-ScheduledTask

 

Share