Tag: PowerShell

Microsoft Teams – Quickly add a Webhook to a Teams channel and send a message using PowerShell

I just discovered the possibility to add Webhooks to a Teams Channel. Since webhooks are nothing new to me, i wanted to know if my PowerShell Scripts i created when i was playing last time with Webhooks if they’re working with the Teams API as well – surprise, i created a Webhook and sent a…




Get your WAN/public IP address using PowerShell and ipify.org

I just discovered the ipify.org service to quickly get your public / WAN IP address. https://www.ipify.org/ – API Usage for IPv4 So to get the WAN / public IP address using PowerShell (New-Object System.Net.WebClient).DownloadString(‘https://api.ipify.org’) Or get it as JSON and ConvertFrom-Json-it (New-Object System.Net.WebClient).DownloadString(‘https://api.ipify.org?format=json’) | ConvertFrom-Json Yeah, i know, my WAN IP is visible in the…




File in use / Use PowerShell to find out witch process is locking a file

When we tried to upgrade to the latest Nextcloud Client (Version2.6.5), we were confronted with the following error message. The file C:\Program Files\Nextcloud\shellext\OCOverlays.dll is in-use and can’t be overwritten -> (if you think about it, it’s already clear that the Explorer Proess ‘locked’ this file, as this library is most likely used to overlay the…




PowerShell Active Directory Module – Cheat Sheet

Retrieve all Windows Server Computer Get-ADComputer -Filter ‘operatingsystem -like "*server*" -and enabled -eq "true"’ ` -Properties Name,Operatingsystem,OperatingSystemVersion,IPv4Address | Sort-Object -Property Operatingsystem | Select-Object -Property Name,Operatingsystem,OperatingSystemVersion,IPv4Address Retrieve all Windows Client Computer Get-ADComputer -Filter ‘operatingsystem -notlike "*server*" -and enabled -eq "true"’ ` -Properties Name,Operatingsystem,OperatingSystemVersion,IPv4Address | Sort-Object -Property Operatingsystem | Select-Object -Property Name,Operatingsystem,OperatingSystemVersion,IPv4Address Retrieve all Domain-Controllers (w/o Member…




Sign your PowerShell scripts with a code signing certificate

Prerequisite is -> you need an issued and world or domain-trusted code signing certificate. Read more about how to issue a code signing certificate (CSR) and how to issue one using your in house Certification Authority Let’s start a PowerShell Console as admin – then use this command to list available code signing certificates: Get-ChildItem…




Install-Package : No match was found for the specified search criteria and package name ‘PsWindowsUpdate’. Try Get-PackageSource to see all available registered package sources.

Yeah, thanks M$, that’s what i always think when i just want to execute a basic task and i get a %&ç*% error message. I always install PsWindowsUpdate to manage Windows Updates on Servers and Workstations i’m responsible for because GUIs.. well, they limit you somehow.. Now, i got this error message again .. it’s…




Install Windows 10 Upgrade 2004/20H2 from command line / using a PowerShell Script

Usually we deploy Windows 10 feature and cummulative updates using a deployment solution like Microsoft Endpoint Configuration Manager or Ivanti DSM or LANDesk or lately using the new Infrastructure Manager which is only available in beta by request. And then, sometimes we need to update notebooks which are not ‘well-connected’. First we used to ship/send…