After some time - 6 months in fact - we were finally able to meet again.
At first we had to postpone PPoSh Meetups because of various personal matters. Then I was attending PSConfEU and had to prepare my talks there. Then Summer Break. But…
At the PSConfEU both Bartek Bielawski and Jakub Jareš asked me if I’m planning any Meetups.
Well, you can’t say no to this :smile:.
Again, thanks to Obejctivity we were able to meet and - suprise, surprise - talk about Pester all day long.
Don’t get me wrong, there’s a time and a place for Notepad++. There was a point in time where I preached how amazing the editor was for all purposes, even for PowerShell! That time is over. As our code increases in complexity, we need a code editor that can keep up with the workload. With Notepad++ and other basic text editors, we have a much harder time doing any code troubleshooting or any debugging on the fly.
Preview 3 of PowerShell 7 was released yesterday. It can be downloaded from the PowerShell repository on GitHub. Be sure to choose the preview version for the appropriate operating system. It should go without saying that anything with preview in its name should NOT be installed on a mission-critical production system. The examples shown in this blog article are being run on a system running Windows 10 (x64).
In the previous post we discussed SharePoint Online cloud service. Now, let’s talk about SharePoint farm deployed on premises. We can specify Primary and Secondary site collection administrators in the SharePoint Central Administration portal by clicking on Application Management and… Continue reading →
Starting on dbatools version 1.0.31 we introduced better coverage for commands that make use of PowerShell Remoting. Which commands? Commands like Get-DbaComputerCertificate, Get-DbaPrivilege, Get-DbaClientAlias, just to mention a few of them, make use of the internal function Invoke-Command2 which uses New-PSSession when we run it against a remote computer. “Why have you changed it?&
PSDay.UK 2019 takes place on Saturday 28th September 2019 in Birmingham at the International Convention Centre (ICC) for a fun day learning PowerShell, DevOps, Cloud & Automation from community & industry experts for Beginners to Advanced practitioners. In this short series of posts, I’m going to highlight the three session tracks from which you can pick … Continue reading PSDa
В предыдущем посте мы рассматривали облачный сервис SharePoint Online. Теперь давайте поговорим о ферме SharePoint, развернутой локально. Мы можем указать первичного (Primary) и вторичного (Secondary) администраторов коллекции сайтов SharePoint в портале SharePoint Central Administration, выбрав в меню пункт Application Management… Читать далее →
Invoke-Command Remote Variables PowerShell Hello, Invoke-Command is great to use one of the “fan out” parallel execution possibilities with PowerShell. Indeed, by default it can execute the same command on 32 servers, simultaneously, without knowing anything about threads or runspaces. … Continue reading →
The post Invoke-Command Remote Variables PowerShell appeared first on It for Dummies.
PoshBot is a chat bot written in PowerShell and created by DevBlackOps. ‘It makes extensive use of classes introduced in PowerShell 5.0. PowerShell modules are loaded into PoshBot and instantly become available as bot commands.’1 PoshBot can do pretty much anything you configure it to do. You can have it create Azure servers, reset Active Directory passwords, create and modify help desk tickets, license Office 365 users, etc.
I’ll be presenting “PowerShell + SQL Server = Better Together” and “Writing Award Winning PowerShell Functions and Script Modules” at SQL Saturday #867 in Baton Rouge Louisiana this Saturday, August 17th. The event is free, although you need to register. Here’s a little information about what you can expect from my sessions: PowerShell + SQL Server = Better Together As a SQL Server professional, are you able to make a rhyme or reason to this thing called PowerShell? Need to accomplish something? Do you use Windows PowerShell or PowerShell Core? How will you interface with PowerShell? With the PowerShell console, ISE, VSCode, SAPIEN PowerShell Studio, or something else? Will you use Cmdlets from one of the various SQL related PowerShell modules? If so, which one? SQLPS, SQLServer, DBATools, etc.
In the SharePoint Online admin portal we can specify the primary admin and the list of other admins in the properties menu of the site. Let’s look at how we can do it in PowerShell. Prologue To interact with SharePoint… Continue reading →
TL;DR: Use . $PSScriptRoot\ instead of . .\ if you’re using where the script is as a reference to load other files. Words: 1033 Time to read: ~ 5 minutes Update (2019-08-14): Thanks to Cory Knox ( twitter | github | twitch ) pointed out that $PSScriptRoot is not available in PS2. I wrote before … Continue reading "Dot Sourcing with PSScriptRoot"
В портале администрирования SharePoint Online мы можем указать как первичного администратора — Primary Admin, так и остальных администраторов в свойствах сайта. Давайте рассмотрим, как это сделать при помощи PowerShell. Пролог Для взамодействия с SharePoint Online через PowerShell, нам потребуется модуль… Читать далее →
Like many other languages, PowerShell has statements for conditionally executing code in your scripts. One of those statements is the if statement. Today we will take a deep dive into one of the most fundamental commands in PowerShell. Index Index Conditional execution The if statement Comparison operators -eq for equality...
While sitting through Jeff Hicks‘ Advanced PowerShell Scripting Workshop at PowerShell on the River in Chattanooga today, he mentioned there being a “Cn” alias for the ComputerName parameter of commands in PowerShell. I’ve previously written a one-liner to find parameter aliases and at one time Microsoft had starting adding parameter aliases to the help for commands as referenced in that same blog article, but it appears that they’ve discontinued adding them to the help and removed the ones they previously added to it.
Auditar la el historial de actividad de PowerShell es algo que puede venir útil en caso de incidentes de seguridad o con fines de documentación. En este post, se muestra como habilitar una transcripción detallada de la actividad de PowerShell mediante directivas de grupo.En una nueva directiva de grupo, ir a "Configuración del equipo > Directivas > Plantillas Administrativas > Componentes de Windows > Windows Powershell" y seleccionar "Activar la transcripción de Powershell".
My last two articles showed you how you can set a computers desktop wallpaper and lock screen wallpaper without having Enterprise or Education by using a PowerShell script and Intune. Now I wanted to figure out how to configure the Windows accent color to also match my corporate branding.
Get Color Values
The first thing we need to do is to get the proper registry values for the color we want to use.
In my previous article I showed you how you can leverage PowerShell and Intune to set a computers wallpaper even if the OS was not Enterprise or Education. Currently, If you want to set the wallpaper or lock screen wallpaper via Intune Policies, you must be on either Enterprise or Education. In this article I will show you how you can leverage PowerShell and Intune, and set your own lock screen wallpaper no matter the version.
DCSync is a tool within Mimikatz that allows you (assuming you have the rights) to impersonate a Domain Controller and request a sync from a live Domain Controller (effectively taking a full copy of the Active Directory database, including all password hashes). The DCSync exploit is well documented HERE. Normally, DCSync attacks are performed after... Continue reading →
Ever wonder how VSCode (Visual Studio Code) maintains those untitled tabs between sessions? They’re stored as files underneath your user’s profile in appdata on Windows based systems as shown in the following example. The previous command could be piped to Get-Content to view the contents of all of code in the open untitled tabs of VSCode. You could also use Select-String to find something specific.
Ansible has modules shell, for executing commands against Linux targets, and win_shell for executing commands against Windows targets – typically using PowerShell. So I was curious to see if it was possible to execute commands in a Linux target using PowerShell Core and if so, how to do it. For my test I have an … Continue reading Running PowerShell Core Commands in a Linux Target from
I shouldn't be telling you that, but Active Directory Backup is an essential part of your Active Directory setup. When a backup of Active Directory happens, AD is aware of it. Following PowerShell solution allows you to get Active Directory Last Backup Time for the whole forest or by domain.
The post Getting Active Directory Last Backup Time using PowerShell appeared first on Evotec.
I’ll be presenting “PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell” at PowerShell on the River in Chattanooga Tennessee this Saturday, August 10th. The event itself is a mini-conference with all day sessions on Friday, August 9th and then numerous speakers presenting in three different tracks on Saturday, August 10th. Here’s a little information about what you can expect from my session: PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell Interested in PowerShell but not sure how to get started? Already have some experience but still having trouble with the basic concepts? This session is for you! Learn to easily figure out what the commands are and how to use those commands without searching the Internet.
********* UPDATE 05/08/2019 ********* It’s been a while (4 years!) since using this script, and have found a few flaws in its logic and execution, especially when it comes to SQL 2000 instances (yes, they’re still very much out there). The script below has now been updated and tested and should work correctly on servers... Continue reading →
Last few weeks, I've been working on making creating HTML based Dashboards, Reports, and Emails better. PSWriteHTML already allows fancy looking reports or emails without much effort, but this release makes it even more helpful. I will be mixing three PowerShell modules in this blost post - PSWriteHTML (responsible for creating HTML/CSS/JS code), Emailimo (simplifies creating emails based on PSWriteHTML) and Dashimo (simple dashboard building).
In this article, we are going to introduce a new PowerShell DSC resource module called AzureFileSyncDsc. Before we get started, let us have a quick overview of what Azure File Sync is.
Azure File Sync
Azure File Sync is a cloud service which makes it possible for customers using Windows File servers to centralize file services in Azure storage, while having a cache in multiple locations for fast, local performance.
One of the common ways to connect to Active Directory is thru LDAP protocol. There are a lot of applications that talk to AD via LDAP. By default Active Directory has LDAP enabled but that's a bit insecure in today's world. That's where LDAPS comes in. It's not easy to set up, but when you get it done, it works. The problem I had recently is that while setting up LDAPS on DC's I only did this on some of the DC's, and not all of them as I should.
The $PSDefaultParameterValues preference variable, which was introduced in Windows PowerShell version 3.0, provides a mechanism for specifying default values for parameters. I thought I would share what I’ve added to mine and ask the community to share theirs. The first one in the list (‘Out-Default:OutVariable’ = ‘LastResult’) is one I picked up from Joel Bennett to store the results of the last command in a variable named $LastResult.
This topic was not initially obvious to me, so hopefully it will help someone out reading this. Consider the scenario where you have an Ansible playbook which executes some PowerShell code via win_shell and you wish to consume the PowerShell output later on in the playbook. The output from win_shell is available in the return … Continue reading Returning Data from PowerShell Scripts to be co
When reviewing permissions on folders, it’s often important to not only know what groups have been assigned access, but to show the members of those groups as well (all in a single report). And what if those groups have nested groups? We should be able to recurse those as well. This script achieves the following:... Continue reading →
By default, there is an Intune device configuration property that can set a devices wallpaper (Profile Type: Device Restrictions > Personalization) BUT this is only applicable on devices running Windows 10 Enterprise and Windows 10 Education. Luckily, using PowerShell we can download a image from the web, save it locally, and set it as our users wallpapers.
First we need to create our PowerShell script.
Show me all your snapshots
We have a cluster with a bunch of VMs. Let’s say around 300 :grin:.
Some actions require us to take a snapshot of certain VMs and then remove them after we’re sure everything is ok.
We are using VeeamOne to track this, but it’s goot do have good old PowerShell take care of the task itself.
There are 3 snippets here I’m using very often:
create new snapshot with a certain name for selected VMs
find all VMs with snapshots of certain name (i.
Hello! Today in this blog post we are going to take a look into: 3 different approaches to Unzip or expand compressed files in PowerShell. All these methods can come...
The post 3 ways to UnZip Compressed Files using PowerShell appeared first on Ridicurious.