![SID-500.COM](https://i1.feedspot.com/4990040.jpg?t=1616485025)
SID-500.COM
713 FOLLOWERS
My name is Patrick Gruenauer. Microsoft MVP on PowerShell. Have fun reading.
SID-500.COM
2w ago
The Measure-Object cmdlet counts objects. But it can do even more. We can calculate the sum, the average and much more. In this blog post I show a few examples with Measure-Object. Let’s dive in.
First of First of all, we can call up the help for Measure-Object here:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/measure-object?view=powershell-7.4
Now I have prepared a few examples. I recommend copying these examples into ISE or VS Code and executing them there to learn the mechanics and the possibilities of this cmdlet.
Here we go:
# Measure-Object
$number ..read more
SID-500.COM
1M ago
NEUER Online-Kurs:
Windows Server 2025 für Einsteiger
um EUR 9,99 (5 Tage gültig bis 29.06.2024)
Gutscheincode: WIN-SERVER2025
oder direkt zum Kurs Angebot:
https://www.udemy.com/course/microsoft-windows-server-2025-fur-einsteiger/?couponCode=WIN-SERVER2025 ..read more
SID-500.COM
1M ago
In this blog post I will show you how to set OneDrive quotas with PowerShell. I’d say here we go!
First, let’s connect to SharePoint Online. Make sure you enter the correct URL and the correct user account.
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Force -AllowClobber
$cred = Get-Credential -Credential patrick@m365ps2022.onmicrosoft.com
Connect-SPOService -Url https://m365ps2022-admin.sharepoint.com -Credential $cred
Next, we need to figure out the URLs.
# Find out all OneDrive URLs
$LogFile = [Environment]::GetFolderPath("Desktop") + "\OneDriveSites.log"
Get-SPOSite ..read more
SID-500.COM
2M ago
It is a good idea to monitor your Hyper-V VMs to get an overview of where resources are being consumed. Microsoft unfortunately doesn’t offer much in this area, this is rather left to other 3rd party companies. Still, we can see a little bit how our VMs are doing. Let’s get started right away!
Enable-VMResourceMetering
We need the Enable-VMResourceMetering cmdlet for this. And a test VM. The configuration is easy and we can start immediately.
Note that Resource Metering is disabled by default!
Open PowerShell and check if metering is enabled.
Get-VM | Select-Object -Property Name,ResourceMet ..read more
SID-500.COM
3M ago
The default value of the maximum number of devices per user in Azure AD is 50 devices. That is a lot. If you want to restrict the number of devices then you came to the right place. In this blog post I will show you how to do this with PowerShell. Let’s dive in.
Prerequisites
In order to set the maximum value we need to connect to Azure AD. First, if not already done, install the MSOnline Module and connect to your tenant.
Install-Module MSOnline
Connect-MsolService
Nice.
Set Maximum Devices per User
To retrieve the current maximum value, run the line below.
Get-MsolDeviceR ..read more
SID-500.COM
3M ago
The cmdlet Wait-Job waits until one or all of the PowerShell jobs running in the session are in a terminating state. In this blog post I will show you an example you can build on. Let’s get started.
Start-Job creates one or more PowerShell background jobs. These jobs are running hidden in the background and enable you to continue your work in PowerShell. This example starts a port scan background job.
Start-Job -Name PortScan -ScriptBlock {Test-NetConnection 192.168.0.150 -Port 88}
Get-Job -Name PortScan
To display the results of this job, run Receive-Job. Note that you can display the ..read more
SID-500.COM
4M ago
Message tracking in Exchange Online can be performed graphically as well as in PowerShell. In this post I will show how to track messages with PowerShell. And you will get a script which you can use in your environment. Let’s jump in.
Prerequisites
If not already done, we need to install the Exchange Online Management Module and connect to Exchange Online.
Install-Module ExchangeOnlineManagement -Force -AllowClobber
Connect-ExchangeOnline
Message Tracking in PowerShell
Next, I’ll show you 4 examples of how you can perform message tracking for a mailbox to display the output either in the co ..read more
SID-500.COM
4M ago
What sounds strange actually works. An offline domain join. Why do you need an offline domain join? Maybe you want to order a completely finished PC from your supplier, which is already joined to the domain without ever having had contact to this domain. Let’s get started.
Steps on the Domain-Controller
Open PowerShell ISE oder VS Code. Provide the domain name and computer name. Then run djoin to deploy your client to the domain.
$domain = 'pagr.inet'
$comp = 'catvie-002'
djoin /provision /domain $domain /machine $comp /savefile $home\$comp.txt
The file should look like this.
Transfer this ..read more
SID-500.COM
5M ago
VS Code is supposed to be the successor of PowerShell ISE. The flexibility of VS Code is enormous, yet there are not only fans of VS Code. To make it easier to get started, I always recommend to activate the Cloud Sync so that VS Code has the same look on all computers and also the extensions are automatically adapted and installed. Let’s get started. In this post I will show you how to enable Cloud Sync.
Turning on Cloud Sync
Install and open VS Code. Click on the icon on the left side to open the Sync menu.
Next, click on Sign in to Sync Settings.
A browser window opens. Enter your credent ..read more
SID-500.COM
6M ago
You want to ping multiple computers at once? Can’t? Yes you can, with PowerShell. In this post I’ll show you a few examples of how you can ping multiple computers. We will use the Test-Connection cmdlet for this task. It’s going to be exciting. Let’s get started.
Open PowerShell 5.1 or PowerShell 7.
Example 1: Ping multiple Computers
Test-Connection -ComputerName sid-500.com,192.168.0.1,microsoft.com -Count 1
Example 2: Ping all Domain-Computers
Test-Connection -ComputerName (Get-ADComputer -Filter * | Select-Object -ExpandProperty Name) -Count 1
Example 3: Ping Computers from Text File ..read more