2,187 questions with PowerShell-related tags

Sort by: Updated
1 answer One of the answers was accepted by the question author.

Powershell script to loop through MSOLUsers in CSV file until they are synced to Azure AD/Entra ID

Hi all, I have an input CSV file like this: UserPrincipalName user1@test.com user2@test.com These users are located in our On Premise Active Directory but are NOT synced to our Azure AD/Entra ID (they are in an OU which we exclude from syncing to Azure…

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,270 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,951 questions
asked 2024-05-30T16:43:46.4033333+00:00
mark terry 45 Reputation points
commented 2024-06-02T16:21:24.9833333+00:00
mark terry 45 Reputation points
1 answer

Cannot create New Entra ID User using Powershell

I am using PowerShell to connect to Microsoft Graph to create new users in Entra ID. I changed Graph version to too many versions but still got these errors. What is wrong with Microsoft? I am using Global Administrator account.

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,951 questions
asked 2024-06-02T13:49:01.2233333+00:00
PHYO AUNG KYAW 0 Reputation points
answered 2024-06-02T14:05:30.7866667+00:00
akinbade abiola 2,580 Reputation points
1 answer One of the answers was accepted by the question author.

Installing GIT with out asking prompts with powershell

I am using below link and using windows 64 bit standalone installer. https://git-scm.com/download/win I can install this manually , but i want to install git in agent ( target machine) using powershell with out asking for any prompts , can we do that, if…

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,321 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,418 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-05-31T09:42:13.34+00:00
Varma 1,250 Reputation points
accepted 2024-06-02T13:59:44.46+00:00
Varma 1,250 Reputation points
0 answers

Getting error while connecting to azure through powershell | A window handle must be configured. See https://aka.ms/msal-net-wam#parent-window-handles

WARNING: Unable to acquire token for tenant 'organizations' with error 'InteractiveBrowserCredential authentication failed: A window handle must be configured. See https://aka.ms/msa l-net-wam#parent-window-handles' WARNING: Please run 'Connect-AzAccount…

Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,030 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-06-02T07:33:15.9566667+00:00
Omkar Urankar 0 Reputation points
1 answer One of the answers was accepted by the question author.

Task scheduler scripts

Hi All i have 100 plus scripts running on a VM. i have task schedulers running daily, for few weekly. i want to export all the task scheduler scripts to a csv file. using the below syntax i am able to export $data = @() foreach ( $task in…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,520 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,408 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,341 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,418 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-04-07T23:46:54.6566667+00:00
Glenn Maxwell 10,451 Reputation points
accepted 2024-06-02T05:42:34.2+00:00
Glenn Maxwell 10,451 Reputation points
2 answers One of the answers was accepted by the question author.

Add exact upns

Hi All i have userprincipalnames in a csv file in the below format. usernames user1@contoso.com user2@contoso.com i want to add these users to AD group from powershell. if there are any other user with user1.a@contoso.com or user2.a@contoso.com. i…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,520 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,408 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,012 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,418 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-04-30T18:33:23.3266667+00:00
Glenn Maxwell 10,451 Reputation points
accepted 2024-06-02T05:42:08.3666667+00:00
Glenn Maxwell 10,451 Reputation points
2 answers

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.

Here is a summary of the steps I took to attempt to execute the Get-MgUserDrive -UserId 'me' command, and why I encountered the persistent "User not found" error: Azure AD application authentication and configuration: I verified that Im…

Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,030 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,913 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
879 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-06-01T14:16:53.5333333+00:00
Mo7Z 0 Reputation points
commented 2024-06-01T20:00:49.26+00:00
Vasil Michev 97,386 Reputation points MVP
0 answers

After 1/2 year API 403 error

I have a PowerShell script that runs daily and creates a folder in the employee contact lists via token (request) and writes the company's contacts in it so that everyone has them on their cell phone. The next day, this folder is deleted and the contacts…

Outlook
Outlook
A family of Microsoft email and calendar products.
3,142 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,913 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-05-28T12:31:31.4833333+00:00
Bonagura Marcello 0 Reputation points
commented 2024-06-01T03:35:08.9233333+00:00
awijekoon 1,335 Reputation points Microsoft Vendor
1 answer

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,187 questions
asked 2024-05-24T19:02:59.75+00:00
Erin Martin 20 Reputation points
commented 2024-05-31T19:35:18.75+00:00
Rich Matheisen 45,186 Reputation points
0 answers

PS script deployed via GPO not installing

Hello experts, I could use some help determining why a PS script deployed via Group Policy is not applying. I suspect it is due to the ExecutionPolicy restriction however I have attempted to bypass in the script parameters as well as adding the bypass…

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,418 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-05-31T15:56:09.6733333+00:00
Eric Ma 0 Reputation points
5 answers

Powershell 5.1 not accepting keyboard input when using Remote Desktop HTML5 Web Client

Install the latest RDS HTML5 client on a RDS deployment as specified here: https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/remote-desktop-web-client-admin Open a web browser session and start an RDS session. …

Windows
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.
4,881 questions
Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,308 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,418 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2023-03-24T15:25:41.6533333+00:00
Ag-8821 41 Reputation points
answered 2024-05-31T09:56:53.34+00:00
Nicolas Guilhot 0 Reputation points
1 answer

Sending via authenticated SMTP failing for one tenant but not the other

I have two tenants, one a prod tenant and one is a test tenant. The user's in both tenants have Authenticated SMTP allowed under 365 Admin Center user settings > mail > managed email apps: In org settings, the global authenticated SMTP setting is…

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.
3,999 questions
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,187 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,951 questions
asked 2024-05-29T05:10:55.3266667+00:00
JohnTristam 20 Reputation points
commented 2024-05-31T09:56:50.4666667+00:00
Noah Ma-MSFT 1,375 Reputation points Microsoft Vendor
0 answers

Getting an error when trying to setup Exchange Online ForwardingAddress in Azure Runbook

Hello, I am trying to setup an Azure Automation Runbook in which I convert a User Mailbox to a Shared Mailbox and setup a ForwardingAddress. I setup all the permissions and converting the mailbox is working, setting a forwarding address throws the…

Microsoft Exchange Online
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,147 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
521 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-05-30T12:31:55.16+00:00
Nick 0 Reputation points
edited the question 2024-05-31T08:14:30.3233333+00:00
Noah Ma-MSFT 1,375 Reputation points Microsoft Vendor
1 answer

What is the best way to execute PowerShell graph command executed against Azure / Entra ID ?

What is the best way to execute the PowerShell graph command executed against Azure / Entra ID ? $date = (Get-Date -Format "yyyy-MM-dd") 2Get-MgRiskDetection -All -Filter "ActivityDateTime ge $date and RiskLevel eq 'high'" The report…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,913 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,418 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,951 questions
asked 2024-05-27T14:14:48.94+00:00
EnterpriseArchitect 4,896 Reputation points
answered 2024-05-31T08:08:46.1833333+00:00
Givary-MSFT 28,756 Reputation points Microsoft Employee
2 answers

Error Handling in ForEach-Object -Parallel CMDLET.

I Use a PowerShell 7 Script to Validate Resource Group and its JSON contents DisplayName, ObjectID and Role Definition Name. My Script will use Parallel block to loop through the subscriptions and validate RG First and then foreach Role Definition it has…

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,418 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-05-30T09:39:05.6366667+00:00
Ramakrishna Abhijeet P 70 Reputation points
edited an answer 2024-05-31T07:18:15.68+00:00
Neuvi Jiang 385 Reputation points Microsoft Vendor
3 answers

Use PowerShell to enable 'Send copies of group conversations and events to group members' on a dynamic O365 group

I have done quite a bit of researching and asking 'Co-Pilot' without any luck. Essentially, I want to do what the title says, which is: Enable 'Send copies of group conversations and events to group members' for the specified group using PowerShell. The…

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.
3,999 questions
Microsoft Exchange
Microsoft Exchange
Microsoft messaging and collaboration software.
420 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-05-23T20:54:43.1533333+00:00
Mark-3345 30 Reputation points
commented 2024-05-31T07:03:06.3566667+00:00
Bruce Jing-MSFT 1,380 Reputation points Microsoft Vendor
0 answers

How to create a webapp slot without copying settings using PowerShell?

I want to create a Slot for an Azure WebApp using PowerShell, without copying any settings from the main production slot. The command I'm using is: New-AzWebAppSlot -ResourceGroupName $ResourceGroup -Name $ApplicationName -Slot $SlotName -ErrorAction…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,070 questions
asked 2024-05-23T09:02:37.6566667+00:00
Vijay Kabbur 0 Reputation points
commented 2024-05-31T04:36:33.4533333+00:00
VenkateshDodda-MSFT 19,401 Reputation points Microsoft Employee
1 answer

Powershell script to Download All Contents ( Folder and Files ) from Sharepoint and Local to SharePoint

Hi There, Good Day. Would like to seek your assistance on how we able to transfer/download Folder with files and sub-folder, files to Local Drive from Sharepoint and Local to SharePoint. Greatly appreciate your feedback. Thank You.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,914 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-05-30T06:10:30.32+00:00
Karl 0 Reputation points
answered 2024-05-31T02:54:32.3+00:00
RaytheonXie_MSFT 32,401 Reputation points Microsoft Vendor
0 answers

The "devtunnel host" command keeps returning an error

I was trying to create a devtunnel (initially in microsoft visual studio debugging, but then the CLI). I have the devtunnel command and I am logged in, but each time I try the devtunnel host command I received the following error: "Error: Tunnel…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,187 questions
asked 2024-05-30T18:03:13.5666667+00:00
Isaac Blackwood 0 Reputation points
edited the question 2024-05-31T01:31:15.84+00:00
Anna Xiu-MSFT 26,731 Reputation points Microsoft Vendor
0 answers

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,187 questions
asked 2024-05-30T18:39:08.3466667+00:00
Anant Bera 106 Reputation points