Home
Microsoft 365
Linux
Windows
Powershell
Cloud Computing
    Citrix Xendesktop
    Citrix XenApp
Useful links
About
  • Home
  • Microsoft 365
  • Linux
  • Windows
  • Powershell
  • Cloud Computing
    • Citrix Xendesktop
    • Citrix XenApp
  • Useful links
  • About
ajni.IT -
Powershell•Windows Client OS•Windows Server

Deploy MS Store App with Powershell – Windows 10/11

November 24, 2024 by AJNI No Comments

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

Reading time: 1 min
Azure•Cloud Computing•Windows Server

Azure Virtual Desktops session duration with Azure Log Analytics and Kusto Query Language (KQL)

November 13, 2024 by AJNI No Comments

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:

Reading time: 1 min
Windows Server

This user’s on-premises mailbox hasn’t been migrated to Exchange Online. The Exchange Online mailbox will be available after migration is completed.

November 6, 2024 by AJNI No Comments

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/

Reading time: 1 min
Windows Server

Public Key Authentication on OpenSSH for WIndows Server not working after October 2024 Updates

November 4, 2024 by AJNI No Comments

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

Reading time: 1 min
Windows Server

Moving Files Doesn’t Update NTFS Permissions to Match New Folder Path

October 30, 2024 by AJNI No Comments

When a file is moved to a different folder on the same NTFS volume, its permissions don’t automatically update to match the destination folder’s settings. Instead, the file keeps its original permissions, which can lead to unexpected access issues if the destination has different security settings

To ensure files inherit the permissions of their new location when moved within the same NTFS volume, you can adjust the Windows Registry to change this behavior. Set the following registry key on the file server:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
MoveSecurityAttributes
REG_DWORD 0

EDIT:

This key does not work on newer Windows Server Operating Systems. It worked on Windows XP/Server 2003.

Reading time: 1 min
Page 4 of 23« First...«3456»1020...Last »

Like what you are reading? Buy me a coffee.

Tip Of the Day

  • Add Alias to Windows Fileserver (Server 2019, 2022, 2025)

    21 hours ago

Keep in touch

Oh hi there!
It’s nice to meet you.

Sign up to receive awesome content in your inbox, every month.

Check your inbox or spam folder to confirm your subscription.

Categories

  • AI & Deep Learning (1)
  • Azure (20)
  • Citrix XenApp (21)
  • Citrix Xendesktop (13)
  • Cloud Computing (40)
  • Coding (1)
  • Hyper-V (10)
  • Linux (8)
  • Microsoft 365 (26)
  • Powershell (21)
  • Security (7)
  • VDI (16)
  • Virtualization (21)
  • VMware (12)
  • Windows (21)
  • Windows Client OS (39)
  • Windows Server (92)

Archives

  • May 2025
  • April 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • April 2023
  • March 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • December 2020
  • November 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019

ajni IT © 2019