Microsoft Q&A

PowerShell

363 questions

A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.

363 questions with PowerShell-related tags

Sort by: Updated
1 answer

Az PowerShell Function - HTTP 204 No Content

Hi All, I need some insight on how to troubleshoot this scenario. I am trying to access the VM using the Az PowerShell Function hosted on the same vnet and this is just a test only. my objective is to access the Windows AD after successfully connecting…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,785 questions
asked 2023-03-14T11:10:55.56+00:00
PS 191 Reputation points
commented 2023-03-23T05:07:57.5+00:00
MayankBargali-MSFT 52,606 Reputation points
1 answer

How to Unallocate the free space in the virtual Disk created from the storage pool

Say Our Initial Disk Size is 128GB. Assume Disk is Empty now we have taken up a Storage pool of 256GB and Created VirtualDisk. Start Mirroring. say after 30 Minutes Mirroring is Done from Initial Disk to VirtualDisk. Now, Remove the Initial…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
6,621 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
8,793 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,734 questions
asked 2023-03-22T12:37:59.8633333+00:00
Sharan Sai 1 Reputation point
edited a comment 2023-03-23T04:45:39.7833333+00:00
Sharan Sai 1 Reputation point
0 answers

SharePoint Online - PnP PowerShell - Remove Installed Apps

Hi MS Q&A, Have been attempting to report on available Apps deployed / installed against a SharePoint Online Site Collections via the following PowerShell operations to help with subsequent removal / uninstall: $web = Get-PnPWeb –Includes…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,445 questions
asked 2023-03-23T01:38:13.5433333+00:00
Daniel Chee 231 Reputation points
edited the question 2023-03-23T04:42:40.65+00:00
Daniel Chee 231 Reputation points
2 answers One of the answers was accepted by the question author.

About PowerShell Scriptblock non work problem

Hi All, I created PowerShell went to auto download adobe reader and auto install, but always show exitcode:87 My Script: #################################### # Catch Local File Cunnect Version # #################################### $Path =…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,734 questions
asked 2023-03-21T01:02:52.5033333+00:00
Hsieh, Iverson 25 Reputation points
accepted 2023-03-23T01:55:32.4833333+00:00
Hsieh, Iverson 25 Reputation points
1 answer

Azure Automation - Source Control - PAT - Powershell

I have created an azure automation account and wish to setup a source control connection with github using a PAT. The PAT has been created with the correct permissions but when I try to run the powershell command I get the following…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
742 questions
asked 2023-03-20T10:28:03.7366667+00:00
JonasD 0 Reputation points
commented 2023-03-23T01:11:26.99+00:00
Ryan Hill 16,451 Reputation points Microsoft Employee
1 answer

Scheduled Task permission issues

Hello Everyone I am having an issue with an ongoing Scheduled task for a Powershell Script. I am only able to run the task when I User who belongs to the Domain Administrator Group, but I cannot let it run with the SYSTEM-User or a User with local…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
2,390 questions
asked 2023-03-22T15:02:26.2066667+00:00
Bühler Gabriel 41 Reputation points
answered 2023-03-23T00:49:09.0366667+00:00
MotoX80 24,711 Reputation points
5 answers

Need some help with using user email address to pull distinguished name.

I have a script which compares existing user attributes with an ADP file and updates them per the file. The script is working well, but it's not able to get the manager distinguished name so it can be changed. Below is the function I'm using, but I don't…

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
3,943 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
asked 2023-03-03T22:38:41.45+00:00
Ricks IT 0 Reputation points
commented 2023-03-22T21:19:07.7633333+00:00
Rich Matheisen 36,161 Reputation points
2 answers

High CPU usage for vmmem

Hi, I have experienced high CPU usage for Vmmem frequently (~every 2days) and the only solution at the moment is simply restart my machine. It is understood that is related to WSL and I do have a Docker image running on Ubuntu on Windows. However it is…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
6,621 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
asked 2023-03-21T19:12:59.2566667+00:00
Steve Lo 0 Reputation points
answered 2023-03-22T19:18:54.26+00:00
Steve Lo 0 Reputation points
3 answers

Trying to change brightness on my desktop screens via powershell and encountered an error

Hello, I want to change the brightness of my screens (I have two screens) on my desktop computer using PowerShell. I use this command: (Get-WmiObject -namespace root/wmi -class WmiMonitorBrightnessMethods).wmisetvrightness(1,20) and I get an error…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,734 questions
asked 2023-03-15T20:24:50.2633333+00:00
דרור פרוחי 0 Reputation points
answered 2023-03-22T15:09:33.29+00:00
Rich Matheisen 36,161 Reputation points
2 answers

Add-Type error MailKit

I am trying to write a Powershell script that runs MailKit.3.6.0 starting with the command: Add-Type -Path "C:\Program Files\PackageManagement\NuGet\Packages\MailKit.3.6.0\lib\netstandard2.0\MailKit.dll" and get the error Add-Type : Unable to…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
asked 2023-03-21T19:21:38.5466667+00:00
Moore, Peter 0 Reputation points
edited an answer 2023-03-22T14:42:48.7333333+00:00
Rich Matheisen 36,161 Reputation points
1 answer

Get-AzRoleAssignment -SignInName "XXX" is not filtering the RoleAssignments of the Resource Level via PowerShell

Hi Guys, Currently i am working on by automate the Azure Role Assignments using PowerShell script. When i use Get-AzRoleAssignment -SignInName "XXX"- i can get the details for some of the users. However, the same command won't return any data…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
390 questions
asked 2023-03-21T15:40:59.9133333+00:00
Mano Kanmani 0 Reputation points
answered 2023-03-22T14:23:24.21+00:00
Limitless Technology 15,521 Reputation points
1 answer

Delete users in a OU after days

I adapted the script below to my needs. I can't get the remove users part to work $Days = 1280 $LastModified = (Get-Date).Adddays(-($Days)) $Users =Get-ADUser -filter {Enabled -eq $False} -SearchBase 'OU=DisabledAccount,DC=adr,DC=it' -properties…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
8,793 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,734 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
3,943 questions
Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
13,506 questions
asked 2023-03-20T17:38:16.4733333+00:00
Matteo Carlini 0 Reputation points
commented 2023-03-22T14:22:30.3166667+00:00
Rich Matheisen 36,161 Reputation points
1 answer

Methodology to Mimic Dynamic Disk Mirroring action for existing volume using StorageSpaces

We are able to mirror the existing data present in a disk with the say Volume F: using the disk management tool /disk part commands. But i would like to replicate this mirroring of Existing Volume using storagespaces. Please do guide me with relevant…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,734 questions
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
6,621 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
4,053 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
8,793 questions
asked 2023-03-16T07:30:38.8333333+00:00
Sharan Sai 1 Reputation point
commented 2023-03-22T12:34:31.8966667+00:00
Sharan Sai 1 Reputation point
1 answer

Current security context error on Microsoft.SqlServer.Management.SMO.Transfer while transfer data to Azure SQL

Lets say that my code looks like this: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null #Source server is a standars MSSQL server $sourceServer = New-Object…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Azure SQL Database
asked 2023-03-22T08:47:14.8566667+00:00
kmieciu2003 0 Reputation points
answered 2023-03-22T10:45:23.97+00:00
Sedat SALMAN 85 Reputation points
1 answer

How to Initialize attached Data disk to Linux VM in Azure with Powershell

The Initialize the disk doc explains how to initialize an attached disk for Windows VM. I need to do the same for Linux VM with Powershell. Any resource available ?

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
382 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,879 questions
asked 2023-03-22T09:24:19.2733333+00:00
Bitchiko Tchelidze 1 Reputation point
edited an answer 2023-03-22T10:40:18.6966667+00:00
Sedat SALMAN 85 Reputation points
1 answer One of the answers was accepted by the question author.

SharePoint Online - PnP PowerShell - Get Installed Apps

Hi MS Q&A, Seeking advice and recommendation on PnP PowerShell cmdlets that can assist with listing the available Apps deployed / installed against a SharePoint Online Site Collection. Had been attempting with Get-PnPApp, however it does not appear…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,445 questions
asked 2023-03-09T02:15:11.06+00:00
Daniel Chee 231 Reputation points
commented 2023-03-22T02:14:53.5366667+00:00
AllenXu-MSFT 4,976 Reputation points Microsoft Vendor
1 answer

Remove Home Teams (Chat) app but keep Enterprise Version on AutoPilot systems

Hi All - We are starting our Windows 11 testing for AutoPilot systems from Intune. We want to get rid of the home version of teams (AKA Chat). However we want to keep the corporate/enterprise version of teams. How can we do this and get rid of the app…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Microsoft Intune Application management
Microsoft Intune Application management
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Application management: The process of creating, configuring, managing, and monitoring applications.
585 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
2,357 questions
Microsoft Intune Configuration
Microsoft Intune Configuration
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Configuration: The process of arranging or setting up computer systems, hardware, or software.
1,130 questions
Windows Autopilot
Windows Autopilot
A collection of Microsoft technologies used to set up and pre-configure new devices and to reset, repurpose, and recover devices.
261 questions
asked 2023-03-21T14:50:12.2366667+00:00
Courtney Regan 26 Reputation points
edited an answer 2023-03-22T02:10:29.5733333+00:00
Crystal-MSFT 21,966 Reputation points Microsoft Vendor
3 answers

Powershell XPATH seems to be not working

I am using Wifi profile xml files as an example. In the below code if i use xpath as $XPath = "//*" I get the list of all nodes in the xml. But if I specify specific node and all nodes under it with $XPath = "//WLANProfile//*", I get…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
asked 2023-03-21T05:12:51.91+00:00
RT-7199 401 Reputation points
answered 2023-03-21T22:03:25.86+00:00
RT-7199 401 Reputation points
1 answer

PowerShell: how to know if email message has never been read

I'm struggling to try to know if an email message has ever been read... I have to use PowerShell Someone can give me some help? thanks!

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
463 questions
asked 2023-02-16T16:24:57.5966667+00:00
Ale Madama 261 Reputation points
edited the question 2023-03-21T21:31:31.0233333+00:00
Mohamed El-Qassas 1,376 Reputation points MVP
2 answers

How to get information on Service Health Incidents with attached PIR (PDF)

Is it possible to get a list (PowerShell or Azure Support REST API) of Service Health Incidents that have a Post-incident report PIR (PDF) attached?

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
363 questions
asked 2023-03-20T16:49:13.8066667+00:00
Domenico Ferraiolo 0 Reputation points Microsoft Employee
answered 2023-03-21T19:45:44.03+00:00
Domenico Ferraiolo 0 Reputation points Microsoft Employee