2,299 questions with PowerShell-related tags

Sort by: Updated
2 answers

Powershell check user in group and then add if not a member

Hi, The script below keeps dropping into the 'Automation has failed...' else statement once a user has been added into a security group. I can see that the user has been added but need the additional check to write the output as these outputs are being…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-24T14:35:09.9866667+00:00
Watts, Steven 0 Reputation points
answered 2023-01-25T19:17:36.9+00:00
Limitless Technology 44,101 Reputation points
1 answer

Checking resource limits, quotas, and constraints using PowerShell

I am seeking a solution to check for resource limit quotas that have been reached in multiple subscriptions using Lighthouse. Has anyone found a way to accomplish this using PowerShell, Graph, or other methods? Essentially, I am looking for a way to loop…

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.
327 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-24T16:01:23.11+00:00
Jason Crawford 0 Reputation points
answered 2023-01-25T19:08:08.91+00:00
Limitless Technology 44,101 Reputation points
2 answers

Powershell how to get Properties values when exporting CSV file

Hello. Need some help, I'm trying to get a report with specific details from the Get-AzRecoveryServicesBackupJobDetail command. So I'm saving the result in an array to later export to a CSV like this: $JobCompletedDetails =…

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,532 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-24T21:31:47.05+00:00
Javier Juarez 21 Reputation points
answered 2023-01-25T16:40:49.87+00:00
Rich Matheisen 45,671 Reputation points
1 answer One of the answers was accepted by the question author.

Get-MgUserAuthenticationMethod fails when AuthenticationMethodId is provided

Get-MgUserAuthenticationMethod fails when parameter AuthenticationMethodId is included. Works fine if only UserId is used: Get-MgUserAuthenticationMethod -AuthenticationMethodId ******** -UserId ********* Get-MgUserAuthenticationMethod :…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,353 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-25T11:59:01.36+00:00
Rafael Varela Pet 20 Reputation points
commented 2023-01-25T14:41:31.01+00:00
Vasil Michev 99,941 Reputation points MVP
2 answers One of the answers was accepted by the question author.

How to configure MAC filtering using only first MAC digits

Dear Microsoft Community, I am a newbie when it comes to DHCP MAC filtering and I am wondering if there is an option ( either trough Powershell or by using a 3rd party option ) to filter MAC addreses using only the first digits of the mac. The idea is…

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,580 questions
Windows DHCP
Windows DHCP
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.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
1,034 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,451 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-23T16:34:24.13+00:00
JPrieto 20 Reputation points
accepted 2023-01-25T14:02:13.75+00:00
JPrieto 20 Reputation points
1 answer One of the answers was accepted by the question author.

Export all users to a CSV file with all OnPremisesExtensionAttributes

Hey Guys I am trying to set up a small script that exports all my AzureAD Users with all their ExtensionAttributes into a CSV-File. Best would be to have a Line for each User with all their Properties. Here is what I have so far: Get-MgUser |…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,353 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 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,503 questions
asked 2023-01-24T14:15:01.5266667+00:00
Bühler Gabriel 76 Reputation points
accepted 2023-01-25T11:00:19.51+00:00
Bühler Gabriel 76 Reputation points
4 answers

Read the Data inside a single Sheet inside .xlsx file using Power shell

I have an .xlsx which have the following:- Stored locally inside C drvie contains 5 sheets One sheet named as "Info", contain rows and columns without tables. first row represents the headers with filters, and the final row contain totals …

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,451 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-23T22:59:35.3733333+00:00
john john 946 Reputation points
edited an answer 2023-01-25T09:17:57.2966667+00:00
Limitless Technology 44,101 Reputation points
2 answers

Auditing and verifying privileged account usage in Active Directory?

How can I check if the certain AD user account is still in use or not? I am in the process of auditing and validating thousands of users across all of these groups: Domain Admins Enterprise Admins Schema Admins Administrators Account…

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.
5,055 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,204 questions
Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,777 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,451 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-25T00:56:57.3366667+00:00
EnterpriseArchitect 5,116 Reputation points
answered 2023-01-25T01:49:23.25+00:00
Thameur-BOURBITA 32,626 Reputation points
6 answers One of the answers was accepted by the question author.

Is it possible to make an RS232 mini char with PowerShell?

Good: I want to make a nice mini chat for the serial port between two PCs. Since I am not familiar, I want help. I have three programs that do the same thing in C#, VB .net and C++ .net in mini chat console mode and it works between them. At least I…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-21T10:45:55.7733333+00:00
Metaconta 41 Reputation points
commented 2023-01-23T22:02:52.2966667+00:00
Metaconta 41 Reputation points
1 answer

Powershell script + SMTP server does not work properly

WARNING! There was an error parsing the document Hello, I have the following script that I found online with my personal modification. I have basic skills in powershell so I'm not a master. The goal is to send an email to the user as soon as he hits a…

Exchange Server
Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,184 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,580 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,451 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-20T13:47:23.19+00:00
Kevin Savard Vertisoft 86 Reputation points
answered 2023-01-23T16:09:29.6566667+00:00
Limitless Technology 44,101 Reputation points
2 answers

It is not possible to identify the user of the actions referring to the powershell events (SecurityEvent Table) through the AMA via xpath

Hi,   Initially when I started the installation in the environment, I noticed that Microsoft's recommendation for collecting Windows logs would be through the AMA agent. However, when starting the collection operational powershell logs via xpath, I…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-19T12:34:56.9966667+00:00
Isaac Falcão 0 Reputation points
accepted 2023-01-23T13:01:56.7833333+00:00
Isaac Falcão 0 Reputation points
3 answers

Powershell script is not running via ps1 file

Hi Team, I wrote a simple script to delete all the files older than X days from my folders without deleting my Folders obviously , i'm able to run it through a command line powershell directly as a command but when i'm calling my ps1 script file in…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-19T13:43:43.3233333+00:00
Shahzeena 0 Reputation points
answered 2023-01-23T08:37:34.84+00:00
Limitless Technology 44,101 Reputation points
1 answer

Query regarding Error code : 87 - The Parameter is Incorrect

Hi, Recently I have faced an Error code 87 in two different instances. Instance 1 : I was trying to apply SACL of a folder named "Test_Folder" using Cacls.exe, It returned the error : 87 , Then I found that the folder is having 1820 DACL's…

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,580 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,511 questions
Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,777 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-18T11:25:55.1966667+00:00
Paramesh T S 1 Reputation point
commented 2023-01-23T06:24:07.4333333+00:00
Paramesh T S 1 Reputation point
1 answer One of the answers was accepted by the question author.

Azure Automation powershell runbook issue

Hello, I am creating an Azure Automation account having a powershell runbook. The script is simply looping over each VM in a resource group and deleting all files under a particular folder. $ResourceGroup = '<<myResourceGroup>>' $TargetDir =…

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,187 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-18T07:32:35.7566667+00:00
Atanu Gupta 141 Reputation points
accepted 2023-01-23T04:53:21.99+00:00
Atanu Gupta 141 Reputation points
0 answers

How to create a shortcut to a folder with PowerShell and Intune

I've been battling this for the past several hours, searching to no avail; there are a couple TechNet posts (e.g. this post ) that don't answer the question and tell the questioner to ask in a different forum, but maddeningly there's neither a link to…

Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,714 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-21T20:50:43.9266667+00:00
RH-8125 111 Reputation points
edited the question 2023-01-21T20:53:40.8133333+00:00
RH-8125 111 Reputation points
0 answers

How to create a shortcut to a folder with PowerShell and Intune

I've been battling this for the past several hours, searching to no avail; there are a couple TechNet posts (e.g.…

Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,714 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-21T20:48:37.98+00:00
RH-8125 111 Reputation points
edited the question 2023-01-21T20:49:24.3233333+00:00
RH-8125 111 Reputation points
2 answers

How to update data in azure AD from a csv file?

Need to update EmployeeID, Department,City,Country,State,StreetAddress,EmployeeType,EmployeeHireDate for 400 users. I keep seeing stuff about running Microsoft graph but I’m having issues with that

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,353 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-18T18:22:39.7366667+00:00
Azim Iqbal 0 Reputation points
edited the question 2023-01-19T22:59:33.5433333+00:00
Marilee Turscak-MSFT 36,246 Reputation points Microsoft Employee
1 answer

关于powershell的Get-WinEvent命令输出问题

powershell:Get-WinEvent -FilterHashtable @{LogName='Security';Id=5024} 输出: powershell:Get-WinEvent -FilterHashtable @{LogName='Security';StartTime=Get-Date;Id=4625} 输出: 上面两张图片中,我想实际的需求如下: 如果执行powershell时有匹配的数据,我想统计所匹配数据的行数; …

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,451 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-19T01:20:05.03+00:00
cscowx 0 Reputation points
answered 2023-01-19T03:28:12.5266667+00:00
Aung Zaw Min Thwin 306 Reputation points
2 answers

PowerShell Invoke-WebRequest : A positional parameter cannot be found that accepts argument XXXXX

Hello, I apologize if this is a basic question but I am very new to PowerShell and trying to learn. I have a script to get specific information about a pc. The script works and I get successfully export the data to a CSV. I am trying to use a webhook…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,299 questions
asked 2023-01-18T17:35:11.2666667+00:00
Kyler Gilbert 0 Reputation points
answered 2023-01-19T00:33:47.48+00:00
MotoX80 32,726 Reputation points