5,455 questions with Windows Server PowerShell tags

Sort by: Updated
1 answer

Sharepoint 2013 - Enable versioning with exception for all documents libraries

Hello, I have a script which enable/update all document library on a web app in SharePoint 2013 : if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin…

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,455 questions
asked 2020-09-02T12:25:18.503+00:00
Andy PANYANOUVATH 1 Reputation point
commented 2020-09-03T03:07:54.987+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
1 answer

Add another course for jobs

How about software testing career and certificiation

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,629 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,455 questions
asked 2020-09-02T19:18:43.877+00:00
Kim Milliner 1 Reputation point
answered 2020-09-03T02:53:56.217+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
1 answer

Imported PowerShell module shows no ExportedCommands

I have a batch of 150-200 Windows 2016 servers that were upgraded to 2019. Following the upgrade about a dozen of them can no longer run commands from an AWS supplied module, while the others can. Upon further investigation we found that importing 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,455 questions
asked 2020-09-01T18:38:48.673+00:00
wallst360 21 Reputation points
commented 2020-09-02T07:37:48.96+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
2 answers

PowerShell script to map a network drive to an IaaS resource within Azure

Hi folks I'm trying to map a network drive from a Windows 10 device to an SMB share within Azure. Here's the scenario: Windows Autopilot device AADJ and Intune enrolled Windows 10 Enterprise M365 E5 license No on-prem access,…

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,455 questions
asked 2020-08-28T09:01:36.477+00:00
RDW 216 Reputation points
answered 2020-09-01T10:44:00.667+00:00
RDW 216 Reputation points
2 answers

gMSA winrm authentication in powershell

How do we use gMSA credentials for remoting another server in same domain

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,455 questions
asked 2020-08-31T05:17:57.45+00:00
Meena S 6 Reputation points
answered 2020-09-01T02:28:40.873+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
1 answer

create varible and loops

Create a variable $intfolders that has a value of 10  Create a variable $intPad that has a value of 0  Create a variable $i that has a value of 1  Create a variable for the new folder o New-Variable –Name strPrefix –Value “test folder” –Option…

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,455 questions
asked 2020-08-31T01:21:15.467+00:00
Archna Virani 1 Reputation point
answered 2020-08-31T15:01:05.137+00:00
Rich Matheisen 45,831 Reputation points
2 answers

Powershell begin Process End output

hi, I have the following simple script, this is not running in a function, its running direct in the script [CmdletBinding()] Param( [Parameter(ValueFromPipeline=$True)] [String[]]$Computers ) Begin { Write-host…

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,455 questions
asked 2020-08-31T10:07:58.093+00:00
Faris Malaeb 1 Reputation point
answered 2020-08-31T14:40:04.667+00:00
Rich Matheisen 45,831 Reputation points
2 answers One of the answers was accepted by the question author.

Invoke-Command -ScriptBlock returns null rather than empty array

I am trying to run supplied commands in an Invoke-Command -ScriptBlock and retrieve the return value. However returning an empty array, @() , results in null being returned (or at least what is stored in the receiving variable). Example: PS…

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,455 questions
asked 2020-08-29T05:32:13.907+00:00
M S 21 Reputation points
commented 2020-08-30T19:23:33.767+00:00
Rich Matheisen 45,831 Reputation points
1 answer

ForeEach-Object Paraellel in PowerShell 7 - Debugging/Breakpoint

We started testing out the features of PS7's parallel option for ForEach-Object items. One of the difficulties we had a hard time overcoming is how is one supposed to debug code (via ISE/VSCode) when setting a breakpoint? For example, in the below code…

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,455 questions
asked 2020-08-30T11:57:16.733+00:00
reuvygroovy 776 Reputation points
answered 2020-08-30T13:37:01.47+00:00
js2010 191 Reputation points
1 answer

powershell function

21130-pow.txt How to define a small function on the above script(line 33) to easily loop through the servers on an error using try/catch to go back and look at the server again for any errors.Any suggestions is highly appreciated

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,455 questions
asked 2020-08-28T15:03:56.657+00:00
Sara 421 Reputation points
answered 2020-08-28T18:54:38.357+00:00
Rich Matheisen 45,831 Reputation points
2 answers One of the answers was accepted by the question author.

powershell filter

, #This will only send the alerts. If (($SendAlert) -and (-not (((get-date).TimeOfDay.totalhours -ge 1) -and ((get-date).timeofday.totalhours -lt 4)))) { …

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,455 questions
asked 2020-08-23T16:29:29.5+00:00
Sara 421 Reputation points
accepted 2020-08-28T14:48:02.197+00:00
Sara 421 Reputation points
1 answer

psRemote Connection Fails Based on Source/Client Machine Config (I think)

I am unable to create a New-psSession FROM a group of computers. Attempting to do so returns an error which includes: “The WinRM client received an HTTP status code of 307 from the remote WS-Management service.” I’ve worked with remoting…

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,455 questions
asked 2020-08-27T13:31:54.997+00:00
TreyS 166 Reputation points
answered 2020-08-27T15:11:20.813+00:00
Rich Matheisen 45,831 Reputation points
1 answer

PnP copy .pst in one site collection to new library in another site collection

We are dealing with SharePoint OnPrem / 2016 in this scenario. I have a library template located in Site Collection 1, and need to create a library in site collection 2 using this centrally located .pst file in Site Collection 1. Every example I've…

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,893 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,455 questions
asked 2020-08-25T18:38:19.707+00:00
CC 96 Reputation points
commented 2020-08-27T09:51:41.643+00:00
Emily Du-MSFT 44,071 Reputation points Microsoft Vendor
1 answer

Moving Folders With FSRM

My team has been asked to set up an automated system to "archive" project directories on our Server 2019 share. In reality they want certain directories to be moved to another location automatically based on a flag file saved within the…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,601 questions
Windows Server Storage
Windows Server Storage
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Storage: The hardware and software system used to retain data for subsequent retrieval.
643 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,455 questions
asked 2020-08-26T14:10:38.583+00:00
Nick 1 Reputation point
answered 2020-08-27T06:51:35.753+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

How to kill a WAC initiated process

Hello, I start Windows Admin Center (WAC) and attach to a remote system. There I open a Power Shell and start my application. That application runs for ever in an endless loop. Now I close my WAC so along with that the PS windows also gets closed BUT…

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,455 questions
asked 2020-08-22T14:05:35.107+00:00
ananda vardhana 21 Reputation points
commented 2020-08-27T03:10:28.547+00:00
Andy YOU 3,071 Reputation points
3 answers

Powershell Script

Hello Everyone, I'm a beginner Powershell user. Could anyone help me to finish this script? I'd like to copy new files from "$a" to "$b"... automatically of course. How should I move on? Thanks a lot.

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,455 questions
asked 2020-08-03T15:49:06.427+00:00
Gabi1986 1 Reputation point
answered 2020-08-27T00:19:32.103+00:00
gastone canali 151 Reputation points
1 answer One of the answers was accepted by the question author.

Script to check if PC has an SSD and assign disk to variable for later use

I'm trying to create a PowerShell script to check if any of the computer's disks is an SSD and then pass that disk number as a variable to other scripts, which will use it to select which disk a Windows image will be installed to. Also, the SSD must be…

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,455 questions
asked 2020-08-26T17:01:47.397+00:00
DD90 21 Reputation points
commented 2020-08-26T21:30:13.007+00:00
DD90 21 Reputation points
4 answers One of the answers was accepted by the question author.

Migrating scripts from Python to Powershell - looking for rstrip equivalent

Hello, I have a pipe delimited data file that I need to read and strip all fields (if necessary) to meet SQL column restraints (for import). In Python, I use rstrip and it works even when a column, for example - Company Name(30) or FirstName(16),…

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,455 questions
asked 2020-08-25T05:29:47.4+00:00
SethWH 436 Reputation points
commented 2020-08-26T18:10:07.763+00:00
Rich Matheisen 45,831 Reputation points
1 answer

Unable to connect to Ad server from RSAT server ?

Our AD server is connected to our server via RSAT server. When we are trying to run the AD commands by doing PSRemoting on RSAT server we are not able to get the desired results. But when we run same commands on RSAT server directly we can see the…

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,213 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,455 questions
asked 2020-08-26T17:01:37.267+00:00
Kshitij Patil 1 Reputation point
answered 2020-08-26T17:51:03.353+00:00
Rich Matheisen 45,831 Reputation points
2 answers

Azure Key Vault Set Secret from PowerShell- Pattern Match Exception

I am trying to bulk insert secrets to my Key Vault using power shell and Its throwing me Secret Validation exception saying Pattern Mismatch- ^[0-9a-zA-Z-]+$ But same secret, if i am doing manually in the portal, its working fine. Need some insights…

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,184 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,455 questions
asked 2020-08-25T15:37:55.327+00:00
Pavan Kumar 1 Reputation point
commented 2020-08-26T17:17:04.15+00:00
JamesTran-MSFT 36,541 Reputation points Microsoft Employee