2,216 questions with PowerShell-related tags

Sort by: Updated
2 answers

Parallel copy of files on multiple servers

I want to copy all the files in a folder called test from ServerA to multiple Servers. I am using command like below, however it is not copying the files: Executing the below script from ServerA $serverlist = New-PSSession -ComputerName ( Get-Content…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-06-13T12:30:07.6566667+00:00
Sam White 6 Reputation points
commented 2024-06-13T17:55:56.4166667+00:00
Rich Matheisen 45,416 Reputation points
2 answers

powershell script to check all Entra ID Role Assignment Members

Hi, Im checking on how i can manage to get all members of Entra ID Role Assignment and Administrators. when i try to export the file only the Scope with Directory is exported, not all members are exported. When i tried the Get-AzureADDirectoryRoleMember…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,079 questions
asked 2024-06-13T11:31:12.8933333+00:00
Darren Ramos 20 Reputation points
answered 2024-06-13T16:47:46.06+00:00
Vasil Michev 98,196 Reputation points MVP
2 answers One of the answers was accepted by the question author.

WARNING: Unable to acquire token for tenant 'organizations' with error 'InteractiveBrowserCredential authentication failed: Method not found: 'Void Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Microsoft.Identity.Client.ITokenCa

Hi Team, Can someone here please assist me with this error to connect my PowerShell session using the Connect-AzAccount ? PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Connect-AzAccount WARNING: Unable to acquire token for tenant 'organizations' with…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,036 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,079 questions
asked 2023-08-08T13:25:14.0933333+00:00
EnterpriseArchitect 4,916 Reputation points
commented 2024-06-13T15:32:52.1333333+00:00
Hani Zougla 0 Reputation points Microsoft Employee
2 answers

Cannot run New-AzActionGroup after New-AzActionGroupReceiver

Hello, I am trying to create a new action group using PS. The group will use webhook. To achieve this I need to create an action group receiver. Code: $ActionGroupShortName = 'Alert' $ActionGroupReceiverName =…

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,920 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.
5,427 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-05-16T10:59:45.49+00:00
Oleg Tserkovnyuk 586 Reputation points
edited an answer 2024-06-13T13:43:04.4266667+00:00
Oleg Tserkovnyuk 586 Reputation points
1 answer

I'm trying to use the Get-MgUserDrive command in PowerShell with the 'me' alias, full email address, and explicit user ID, but keep getting a 'User not found' error

I run the command below in powershell with using the Invoke-MgGraphRequest cmdlet. Please find below the Powershell Command´s Screenshot and the error message. Here is the Error msg: What do you suggest? Gemini propose an Alternative…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,036 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-06-12T17:00:19.47+00:00
Mo7Z 0 Reputation points
commented 2024-06-13T11:44:46.4366667+00:00
Mo7Z 0 Reputation points
1 answer

Getting certificates details using Invoke-Command powershell gives error

Invoke-command -computername server1 -ScriptBlock { dir cert: -Recurse | Where-Object { $_Subject -like 'server1' }} Gives error The system cannot open the device or file specified. Please help on how to this.

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-06-10T14:05:33.4566667+00:00
Sam White 6 Reputation points
commented 2024-06-13T11:41:25.8+00:00
MotoX80 32,441 Reputation points
0 answers

Connect-ExchangeOnline started giving a strange error

Hello all, I created a script in powershell to collect mailbox information from our tenants on Exchange Online. It stopped working somewhere aroung the 1st of May. Im going to explain what my process is in some detail and when the error occurs. There are…

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,299 questions
Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
320 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-06-12T09:01:52.5533333+00:00
Milos Boksan 0 Reputation points
commented 2024-06-13T11:40:08.2733333+00:00
Milos Boksan 0 Reputation points
3 answers

Azure Virtual Desktop Auto Shutdown and Power On

Hello All, We're currently managing a pool of 30-40 VMs, and to optimize our licensing costs with Microsoft, we're planning to shut down idle VDI VMs that haven't been used in over 8 hours. To automate this process, could you assist us with a PowerShell…

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,365 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,158 questions
Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,408 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-06-03T06:49:38.01+00:00
Madhukar Mali 0 Reputation points
commented 2024-06-13T09:17:49.4766667+00:00
Madhukar Mali 0 Reputation points
1 answer

How to enable schedule patching on azure vm using powershell

I am using below command as per documentation https://learn.microsoft.com/en-us/azure/update-manager/prerequsite-for-schedule-patching?tabs=new-prereq-powershell%2Cauto-portal&WT.mc_id=Portal-Microsoft_Azure_Automation#code-try-4 But it is asking to…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
261 questions
asked 2024-05-10T11:18:38+00:00
Azuretech 90 Reputation points
commented 2024-06-13T08:59:26.06+00:00
techazure 0 Reputation points
2 answers One of the answers was accepted by the question author.

Run script on multiple users (using Excel table)

Hello everyone, im trying to build a PowerShell script that runs a command multiple times but with different URLs, but i cant quite understand how to build it. The point is to remove a user from the Share Point sites listed in the column D. So lets say…

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,598 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,001 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-06-10T08:03:49.4266667+00:00
Emiliano 20 Reputation points
commented 2024-06-13T08:01:59.01+00:00
Emiliano 20 Reputation points
1 answer

Powershell scripts in System Center Orchestrator 2022

Hi all, We are trying to move from SC Orchestrator 2012 to 2022 version. in previous version, we were using the Powershell integration Pack which allowed us to run PowerShell scripts in remote machines and use output of those scripts in runbook. Since…

System Center Orchestrator
System Center Orchestrator
A family of System Center products that provide an automation platform for orchestrating and integrating both Microsoft and non-Microsoft IT tools.
218 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-06-10T17:48:43.7833333+00:00
Bilel Moakhar 0 Reputation points
commented 2024-06-13T06:20:03.0166667+00:00
Andreas Baumgarten 99,371 Reputation points MVP
1 answer

How to get the Sleep Setting and set new Sleep Setting for System from PowerShell?

Hey Experts, We are looking for a PowerShell command to get the current sleep time interval from the system and set a new time interval for the system. Currently, we have four sleep settings in the system, and we want all the settings to be retrieved and…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-05-30T18:39:08.3466667+00:00
Anant Bera 131 Reputation points
answered 2024-06-12T15:21:39.2433333+00:00
James Detty 0 Reputation points
1 answer

Get-MgUserPhotoContent does not return what was set using Set-MgUserPhotoContent

Describe the bug When using Set-MgUserPhotoContent and then Get-MgUserPhotoContent, the returned value is not the same as was set using Set-MgUserPhotoContent. I assume the image is compressed. To Reproduce Set-MgUserPhotoContent -infile…

Microsoft Exchange Online
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,036 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,299 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2023-10-30T12:50:08.5433333+00:00
Müller Martin 5 Reputation points
answered 2024-06-12T14:54:42.1566667+00:00
Miguel Gonçalves | AVANADE 441 Reputation points
2 answers

I need the powershell command to active the PIM eligible assignment

Hello Microsoft. My Requirement is i have Multiple PIM Role Eligible Assignments in Azure. I am not using MFA for activate, just using the Justification so every day I need to active the multiple roles which is taking time to activate all the role. Is…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
Microsoft Entra Private Access
Microsoft Entra Private Access
Microsoft Entra Private Access provides secure and deep identity-aware, Zero Trust network access to all private apps and resources.
51 questions
asked 2024-06-11T15:04:38.1066667+00:00
Rajesh Padigae 0 Reputation points
answered 2024-06-12T08:18:18.8933333+00:00
Rajesh Padigae 0 Reputation points
1 answer One of the answers was accepted by the question author.

Change Product Key of Windows Server 2022 using Ansible and/or PowerShell script

Hi there, I am trying to automate the process of provisioning a Windows Server based Virtual Machine using Azure and Ansible. My company has some Windows Server product keys available through the Microsoft Partner Program. My goal is to use one of these…

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,365 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,403 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.
5,427 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-04-30T07:44:01.64+00:00
Erik Burmester 20 Reputation points
accepted 2024-06-12T05:53:11.75+00:00
Erik Burmester 20 Reputation points
5 answers

Connect-SPOService : No valid OAuth 2.0 authentication session exists ?

How to fix the issue to connect to SharePoint Online using PowerShell like below? Because when I am using the PowerShell ISE, and then the command: Connect-SPOService -Url 'https://CompanyName-admin.sharepoint.com' I got the error:…

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,271 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,001 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,590 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,862 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2023-02-20T02:47:20.1466667+00:00
EnterpriseArchitect 4,916 Reputation points
commented 2024-06-12T00:54:12.08+00:00
Anindya Kumar Banerjee 0 Reputation points
0 answers

ExchangeOnline Powershell - Get-QuarantineMessage -ReleaseStatus Requested no results

I'm having a problem running a Get-QuarantineMessage Powershell script for ExchangeOnline in Powershell. My manager is able to run it connecting to the exact same account and get results. When I run it, I just get brought back to the prompt without any…

Microsoft Exchange Online
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-05-24T18:56:18.4+00:00
Erin Martin 40 Reputation points
commented 2024-06-11T22:12:41.7466667+00:00
Miguel Gonçalves | AVANADE 441 Reputation points
1 answer

Intune Configuration Profiles, Remediation and Preferred Wi-Fi SSID

We are attempting to replace an existing wifi network that uses standard RADIUS. With a new network uses PSK without RADIUS for authentication. The goal is to get our fleet of Windows devices (mostly 10s, and a few 11s) to switch over to the new network…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,932 questions
Windows Network
Windows Network
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Network: A group of devices that communicate either wirelessly or via a physical connection.
680 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,603 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,768 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2024-04-18T16:45:57.4633333+00:00
Maranya, Damon 316 Reputation points
answered 2024-06-11T13:30:02.5833333+00:00
Miguel Gonçalves | AVANADE 441 Reputation points
1 answer One of the answers was accepted by the question author.

Why Remove-MailboxFolderPermission fails if user specified in User property doesn't have any mailbox?

ExoModuleVersion: 3.2.0 Problem:  Remove-MailboxFolderPermission cannot remove permission if the user specified in User property doesn't have any Exchange Online mailbox. The cmdlet fails with the following error:…

Microsoft Exchange Online
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
asked 2023-09-20T07:31:27.8066667+00:00
Volodymyr Dumchykov 41 Reputation points
commented 2024-06-11T12:20:15.37+00:00
Henning Tranberg 0 Reputation points
0 answers

Ways on how to manage azure Devices and Find device location per office

Hi, Im on creating some automation to delete all stale devices in Entra ID (not in intune) and i need to find a way to find each device location so i can separate them every office. are there any ways to check the device location or physcial location? im…

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.
5,427 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,216 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,079 questions
asked 2024-06-04T13:06:28.0866667+00:00
Darren Ramos 20 Reputation points
commented 2024-06-11T09:09:42.4766667+00:00
Givary-MSFT 29,261 Reputation points Microsoft Employee