2,312 questions with PowerShell-related tags

Sort by: Updated
2 answers

Create a table-like custom object from a variable with CSV content

Hi, I have contents in a variable called $file echo $file gives this Timestamp,Category,OperationName 2022-10-26 19:21:23.5114273,Warning,Insert 2022-10-26 19:21:23.5114273,Warning,Update As you see, the variable is really a CSV. I want to create a…

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,456 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-30T01:12:41.1666667+00:00
Biju Mathew 481 Reputation points
answered 2023-01-30T01:47:14.2566667+00:00
Biju Mathew 481 Reputation points
4 answers One of the answers was accepted by the question author.

Error to publish module to private repository

I’m trying to publish a module, which I wrote, to a local repository. The repository is correctly created, if I type get-psrepository I see it. When I launch the command Publish-Module -Path C:\Modules\mymodule -Repository MyRepository the error…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-25T11:28:34.6466667+00:00
Francesco Farina 20 Reputation points
accepted 2023-01-29T12:55:33.91+00:00
Francesco Farina 20 Reputation points
3 answers

interacting with an API using powershell using an API-KEY

I am wanting to retrive data from an API using powershell Ideally it would work the same way this curl command works , any suggestions? [root@svd-nmrobm01 ~]# curl -d '{"sam_account_name":"smithm"}' -H "Content-Type:…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-27T16:07:58.8666667+00:00
rob m 256 Reputation points
answered 2023-01-28T02:43:30.3333333+00:00
Rich Matheisen 45,831 Reputation points
0 answers

Your domain controller performance is very critical for that you need to write, test and schedule a PowerShell script called “PerfMonitor.ps1” that runs daily at 10:00 AM and repeats every one hour to chck if there is any process that taking more than

Your domain controller performance is very critical for that you need to write, test and schedule a PowerShell script called “PerfMonitor.ps1” that runs daily at 10:00 AM and repeats every one hour to chck if there is any process that taking more than…

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,161 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,600 questions
Windows Hardware Performance
Windows Hardware Performance
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.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,577 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,456 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-27T19:01:35.6133333+00:00
jake4312 0 Reputation points
commented 2023-01-27T20:08:36.5166667+00:00
Rich Matheisen 45,831 Reputation points
0 answers

Unable to find custom list template and differentiate custom template list and normal list?

Hi, I have created a list custom template from PowerShell utility (Used script from here [https://learn.microsoft.com/en-us/sharepoint/lists-custom-template). Now I am able to see new custom template in 'From your organization' during list creation…

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,257 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,803 questions
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
549 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-26T16:31:58.53+00:00
Yuvraj Patil 361 Reputation points
edited the question 2023-01-27T17:00:18.63+00:00
Obaid Farooqi MSFT 591 Reputation points Microsoft Employee
0 answers

How to pin/un-pin programs in start menu and starkbar windows 11

Im automating some stuff and would like some help, can anyone help me create or show a working powershell script example that can add or remove pinned programs in the task bar and start menu in windows 11? Im not really versed with powershell, i cant…

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,939 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-27T16:47:54.34+00:00
Drake Jest 0 Reputation points
0 answers

Invoke-WsusServerCleanup not finishing

We ran into an issue where our update server would not successfully run cleanup for the "Unused updates and update revisions" and "Unneeded update files" options when running the WSUS Server Cleanup Wizard. It kept giving the…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-27T14:48:00.6833333+00:00
tturner226 1 Reputation point
2 answers

Invoke ADF pipeline using powershell script

i have run the below code but it does not seems to be. i'm geting below rerror Invoke-AzDataFactoryV2Pipeline : The term 'Invoke-AzDataFactoryV2Pipeline' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the…

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,142 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-18T05:06:11.7533333+00:00
Josh 46 Reputation points
commented 2023-01-27T05:02:45.5833333+00:00
PRADEEPCHEEKATLA-MSFT 85,351 Reputation points Microsoft Employee
2 answers

Facing: New-ServicePrincipal : The term 'New-ServicePrincipal' is not recognized as the name of a cmdlet, function, script file, or operable program.

Im trying to setup xoauth2 for our helpdesk aplication. Im following below commands to configure exchange. Install-Module -Name ExchangeOnlineManagement Install-Module Microsoft.Graph Install-Module -Name AzureAD import-module AzureAD Import-module…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-26T08:55:33.4333333+00:00
Paweł Mrzygłód 0 Reputation points
answered 2023-01-26T17:05:57.2566667+00:00
Limitless Technology 44,101 Reputation points
2 answers

Powershell backup-sqldatabase -ExpirationDate

Greetings! I'm just having a bad time trying to set the expiration date to a SQL Server backup through powershell SQLSever Module. My need is that the next backup overwrites the current file in the directory. I've Tried to achieve that with: $Expira =…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-25T15:28:27.3733333+00:00
ti1 embracon 0 Reputation points
answered 2023-01-26T16:57:07.26+00:00
Limitless Technology 44,101 Reputation points
2 answers

Microsoft.Data.SqlClient PowerShell

I would like to use the Microsoft.Data.SqlClient namespace/ objects in a PowerShell script. Two (click1, click2) GitHub posts provide a way to load the dll's, but does Microsoft provide any (official) PS module which could be imported? I don't want the…

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-25T15:07:03.2133333+00:00
Odrai 0 Reputation points
answered 2023-01-26T16:30:35.41+00:00
Limitless Technology 44,101 Reputation points
3 answers

Find all users assigned to external access policy for teams

Is there a command in powershell to list out all users assigned to a certain CsExternalAccessPolicy?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,591 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-25T15:06:50.82+00:00
Tony 0 Reputation points
answered 2023-01-26T16:25:45.65+00:00
Limitless Technology 44,101 Reputation points
4 answers One of the answers was accepted by the question author.

Using ForEach with If to Check Computer Accounts for Group Memberships

I'm working on a script that checks the members of an OU to see if they are members of a corresponding group. The script currently just adds devices from the OU to the related group. What I want is for the script to check each device in the OU to see if…

Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,432 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,216 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 questions
asked 2023-01-24T21:36:59.55+00:00
Maranya, Damon 316 Reputation points
commented 2023-01-26T15:14:47.91+00:00
Maranya, Damon 316 Reputation points
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,312 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.
328 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 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,562 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 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,831 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,409 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 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 100K 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,600 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,035 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,456 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 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,409 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 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,629 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,456 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,312 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