5,381 questions with Windows Server PowerShell tags

Sort by: Updated
2 answers

Error running Set-AIPFileLabel from Azure PowerShell function - Engine is not initialized, bootstrap might have failed

Trying to remove AIP sensitivity labels from PDF documents using PowerShell Azure Function (triggered by power automate flow passing the file content from SharePoint). Based on this documentation:…

Azure Information Protection
Azure Information Protection
An Azure service that is used to control and help secure email, documents, and sensitive data that are shared outside the company.
517 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,287 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,381 questions
asked 2022-07-22T05:56:18.16+00:00
Bartski 1 Reputation point
commented 2024-04-12T14:07:40.0733333+00:00
Mike Crowley 121 Reputation points
2 answers One of the answers was accepted by the question author.

extract .zip files from multilple locations with Batch or Script file

I have a bunch of folders that contain .zip files. is it possible to run a batch that will search for zip files in multiple folders and automatically unzip them in the parent folder?

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,381 questions
asked 2021-09-02T16:46:54.3+00:00
Tellu Wsup 21 Reputation points
commented 2024-04-12T10:45:07.11+00:00
Mohan Subramaniam 0 Reputation points
3 answers

Get list of installed features and roles on all domain servers - Powershell

Get list of installed features and roles on all domain servers - Powershell Get-ADComputer -Filter 'operatingsystem -like "server" -and enabled -eq "true"' ` -Properties Name,Operatingsystem,OperatingSystemVersion,IPv4Address | …

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,890 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,381 questions
asked 2022-05-09T21:48:05.24+00:00
Naveen Kumar 21 Reputation points
commented 2024-04-12T08:27:53.5866667+00:00
Ryan Instone 0 Reputation points
2 answers

how to list the custom attribute in AD

Hello, we migrated from old to new AD environment ,need to check all the custom attribute list including any extension custom attribute so that same can be created in new environment. I couldn't find any script that work well ,I tried below commands but…

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,890 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,381 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,073 questions
asked 2024-04-11T10:50:48.1866667+00:00
Richa Kumari 286 Reputation points
answered 2024-04-12T04:18:45.5333333+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,891 Reputation points Microsoft Vendor
0 answers

Error while executing CLI script on windows VM for a storage account.

Encountered an error shared at the link below while running a script on the Windows CLI to list data from a storage account. https://github.com/Azure/azure-cli/issues/28534

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,436 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
322 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,381 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,073 questions
asked 2024-04-09T17:57:58.2433333+00:00
$@chin 80 Reputation points
commented 2024-04-11T21:41:16.9933333+00:00
KarishmaTiwari-MSFT 18,522 Reputation points Microsoft Employee
1 answer

Powershell script for reading Excel Table and send e-mails

Hello community, Basically I would like to have a powershell code that reads a Table inside an Excel WorkBook and send e-mails to some recipients based on a specific column. That table contains some user's information and the e-mail must be sent to the…

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,381 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,073 questions
asked 2024-04-09T17:30:10.8566667+00:00
Mayckel TS 21 Reputation points
commented 2024-04-11T18:42:01.3733333+00:00
Rich Matheisen 45,011 Reputation points
7 answers One of the answers was accepted by the question author.

AD Bulk change of EmployeeID with Email form CSV Import

Hi There, I want to be able to Add/update employeeID attribute in AD from a CSV import, the CSV will have two columns: Email address and EmployeeID, so I want the script to be able to search for the user using email address and then add the…

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,381 questions
asked 2021-06-18T15:06:46.367+00:00
I Perez 26 Reputation points
answered 2024-04-11T10:34:39.7333333+00:00
lakshminarayana pothina 5 Reputation points
2 answers One of the answers was accepted by the question author.

Connect-MgGraph with pre-selected account

Is it possible for microsoft graph powershell to support login with pre-selected account as parameter? ie. Something like this: Connect-MgGraph -AccountId xxx@xxx.xxx.xx Because I see teams powershell can already login to a specified account id,…

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,627 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,381 questions
asked 2022-08-30T07:57:21.927+00:00
Liou, Fang-Ting 21 Reputation points
commented 2024-04-10T19:15:11.79+00:00
Alexandros Kanakaris 36 Reputation points
1 answer One of the answers was accepted by the question author.

Format output from powershell

Good Morning, I'm trying to format the output from the below PowerShell script into a table so it can be imported into an excel spreadsheet. Get-ADGroupMember -Identity "GroupA" | ForEach-Object { Get-ADUser -Identity…

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,381 questions
asked 2021-03-18T11:58:52.283+00:00
lee roberts 186 Reputation points
commented 2024-04-10T18:25:22.4066667+00:00
Rich Matheisen 45,011 Reputation points
1 answer

Running Azure Powershell script on Azure portal

Hi Team, On Azure portal, i need to run below Azure Powershell script, could you please mention how could I run it - $FunctionApps = Get-AzFunctionApp $AppInfo = @{} foreach ($App in $FunctionApps) { if ($App.Runtime -eq 'dotnet') { …

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,287 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,381 questions
asked 2024-04-02T17:37:50.6533333+00:00
Salil Singh 0 Reputation points
edited an answer 2024-04-10T04:15:26.6433333+00:00
MayankBargali-MSFT 68,641 Reputation points
1 answer

Need to create Powershell report for SQL Always on secondary serves.

Hello All, A strange request. We are running multiple always on servers. Backups takes place on secondary replica of always on server. I need to create a report in powershell or t-sql that would identify secondary replica and verify backup…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,747 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,381 questions
asked 2024-03-28T19:56:55.6533333+00:00
Parag Kambli 0 Reputation points
commented 2024-04-09T20:16:59.76+00:00
Erland Sommarskog 101.1K Reputation points MVP
3 answers

Windows powershell - missing argument parameter

net user Game Account /time:M-F,6am-8am;M-F,3pm-5pm;M-F,8pm-10pm error: At line:1 char:44 net user Game Account /time:M-F,6am-8am;M-F,3pm-5pm;M-F,8pm-10pm ~ Missing argument in parameter list. At line:1 char:56 net user Game Account…

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,381 questions
asked 2022-09-16T16:34:50.313+00:00
YAEL ELIAS 1 Reputation point
commented 2024-04-08T19:30:08.1033333+00:00
Richard Navarrete 0 Reputation points
1 answer

.Net runtime version for function app

Hi Team, I have a requirement where I need to find the .net runtime version used in my function apps. Below are imp points - Target framework in csproj file of function app is net6.0. On Azure portal,. under app settings of function app, value of…

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,287 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,381 questions
asked 2024-04-04T11:31:11.24+00:00
Salil Singh 0 Reputation points
commented 2024-04-08T11:04:08.1533333+00:00
Salil Singh 0 Reputation points
9 answers One of the answers was accepted by the question author.

An empty pipe element is not allowed

Hi All, can anyone help me correct the syntax. i am unable to export the output to a text file [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) { …

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,468 questions
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,374 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,381 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,073 questions
asked 2024-04-01T06:51:47.3433333+00:00
Glenn Maxwell 10,146 Reputation points
accepted 2024-04-05T20:49:10.89+00:00
Glenn Maxwell 10,146 Reputation points
1 answer

powercfg /Qh return wrong result

powercfg /Qh return wrong result After set lid close action "do thing" then query again window return wrong result. powercfg /setdcvalueindex scheme_current sub_buttons lidaction 0 powercfg /setacvalueindex scheme_current sub_buttons…

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,198 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,381 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,073 questions
asked 2024-04-01T07:42:11.4766667+00:00
Khanh Nguyen 0 Reputation points
commented 2024-04-05T07:39:17.6666667+00:00
Khanh Nguyen 0 Reputation points
1 answer

work account locked

Error Code: 50057 Request Id: f11c05e3-8f37-4a28-b43e-380209fc7e00 Correlation Id: ce7d1ed3-e750-4ae5-9006-7738bcb6dd0f Timestamp: 2024-03-23T18:57:35.243Z

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,161 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,121 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,381 questions
asked 2024-03-23T19:03:00.8666667+00:00
Bonnie Chi 0 Reputation points
edited the question 2024-04-05T00:29:39.3366667+00:00
KarishmaTiwari-MSFT 18,522 Reputation points Microsoft Employee
0 answers

Using SecretManagement and SecretStore PS modules with gMSA scheduled task is running under

Hi, I'd like to securely store Entra ID App secret using SecretManagement and SecretStore PS modules and then use that secret to connect to MS Graph inside PS script (executed periodically as scheduled task running under gMSA). Is that technically…

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,381 questions
asked 2024-04-04T12:09:44.0966667+00:00
Bojan Zivkovic 436 Reputation points
1 answer

gMSA Error with DNShostname in Powershell

Hey all, I'm trying to create a new gMSA account and I was following some youtube vids and I'm coming across an error. I first started by using command "add-kdsrootkey" then I waited the 10 hours and basically continued the commands the…

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,381 questions
asked 2022-08-26T18:59:10.227+00:00
RS4KING 11 Reputation points
commented 2024-04-03T16:14:55.1+00:00
Beystor Makoala 0 Reputation points
3 answers

Sending an email notification using PowerShell

Hello. I am running Windows Server 2019, and I am running the PowerShell script shown later in this posting. The particulars for Powershell are the following: Major Minor Build Revision 5 1 17763 4974 The script that I am running is…

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,764 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,381 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,073 questions
asked 2024-04-02T15:40:37.1866667+00:00
Kaplan, Andrew H 101 Reputation points
answered 2024-04-03T05:30:49.6333333+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,891 Reputation points Microsoft Vendor
2 answers

Mangement Tools connection

Hi Team,    I allow port 80 to the server so that PS can work. But security team concern in why we are not using default port  By default PowerShell will use the following ports for communication (They are the same ports as WinRM)   TCP/5985 = HTTP …

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,806 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,161 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,381 questions
asked 2024-04-01T08:34:09.5166667+00:00
Muhammad Safeer Saqib 1 Reputation point
answered 2024-04-03T02:26:12.0633333+00:00
Jing Zhou 2,240 Reputation points Microsoft Vendor