Here are 2 quick lines of code that help you uninstall a Program:
$Prog = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -match “ProgramName”}
$Prog.Uninstall()
Reading time: 1 min
Here are 2 quick lines of code that help you uninstall a Program:
$Prog = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -match “ProgramName”}
$Prog.Uninstall()
If you need to deploy a MS Store App for example through Intune or GPO, here is my script:
First of all you need the App ID of the store app. Go to https://apps.microsoft.com/ search for the app and select it. In the URL you will see something like this: https://apps.microsoft.com/detail/9nw77489ngj0?hl=en-us&gl=US. 9nw77489ngj0 is the App ID.
Now the script:
Start-Transcript -Path “C:\3cx_msstore.log”
$appid=”9NW77489NGJ0″
winget install -e –id $appid –source msstore –accept-source-agreements –accept-package-agreements
winget upgrade –id $appid
Stop-Transcript
This KQL query helps you compute the user’s session duration in the last 30 days.
WVDConnections
| where State in (“Started”, “Connected”, “Completed”) // Filter relevant states
| where TimeGenerated >= ago(30d) // Get records from the last 30 days
| summarize
StartTime = minif(TimeGenerated, State == “Started”), // Earliest time for “Started”
EndTime = maxif(TimeGenerated, State == “Completed”), // Latest time for “Completed”
HasConnected = countif(State == “Connected”) > 0, // Check for “Connected” event presence
SessionHostName = anyif(SessionHostName, State == “Started”) // Capture the server name associated with the session
by CorrelationId, UserName
| extend DurationMinutes = iff(HasConnected and isnotnull(StartTime) and isnotnull(EndTime),
datetime_diff(“minute”, EndTime, StartTime),
-1) // Use -1 as a placeholder for invalid durations
| where DurationMinutes >= 0 // Filter out invalid durations (those set to -1)
| extend SessionDurationHours = DurationMinutes / 60.0 // Calculate duration in hours
| project UserName, CorrelationId, StartTime, EndTime, DurationMinutes, SessionDurationHours, SessionHostName
| order by StartTime desc // Order by StartTime for clarity
The output looks something like this:
Are you getting this error in Microsoft 365 Admin center when viewing mail tab of a user? And on-prem Exchange has already been decomissioned? Well, you kinda have to “fake” the migration and clear some user’s attributes:
In AD Users and Computers, make sure Advanced Features are activated (View > Advanced Features). Go to the users OU and double click on the user. Select AttributeEditor and clear the following attributes:
msExchMailboxGuid
msExchRecipientDisplayType
msExchRecipientTypeDetails
Run AD / Entra Sync:
Start-ADSyncSyncCycle -PolicyType Delta
Wait for 15-30min and now the user will get an Exchange Online Mailbox if he has a license.
References:
https://techpress.net/this-users-on-premises-mailbox-hasnt-been-migrated-to-exchange-online/
If your users are having issues logging in to your OpenSSH Server for Windows Server after the latest October 2024 Windows Updates, this might help you:
Firstly, configure logging so that you can see what is happening:
Change the config file:
C:\ProgramData\ssh\sshd_config
SyslogFacility LOCAL0
Restart OpenSSH Service
In my environment i saw this error:
userauth_pubkey: signature algorithm ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
The solution is pretty straight forward. Add this line at the top of your OpenSSH config file:
C:\ProgramData\ssh\sshd_config
PubkeyAcceptedAlgorithms +ssh-rsa