Questions tagged [powershell]

An interactive shell, scripting and programming language, and surrounding environment from Microsoft. Commonly used by system administrators managing Microsoft software (including Windows, Exchange, SharePoint, and cloud services Azure and Office 365), PowerShell is included by default with Windows, and takes over from previous languages such as VB Script.

PowerShell exists to create a more powerful shell than Command Prompt, a more capable language than VBScript, and an environment with built-in support for remote servers and code documentation. Since its introduction, Microsoft added support for PowerShell scripting to many of their core products.

This comment by Jeffrey Snover, one of the original designers of PowerShell, explains the ideas and intent behind the language, and why it was developed instead of porting something like Bash from a Unix environment.

PowerShell provides a vastly improved scripting environment for Windows compared to previous .bat and .vbs methods; it includes PowerShell ISE - an editor and debugging environment, on the language side it has easy support for using lists, hashtables and regular expressions for pattern matching, as an interactive shell it has tab completion for command parameters and interactive help via Get-Help, and it can natively work with COM objects, WMI, registry values, call out to any .Net Framework method or library, and create and use modules written in PowerShell code.

Microsoft Software that supports PowerShell for management includes: Windows Server (and many roles and features - Active Directory, IIS, DNS Server), Exchange Server, SQL Server, SharePoint Server, Windows Azure, and Office 365 components. Here is a full list of PowerShell modules included in Windows Server 2012 and Windows 8.1.

First released in 2006 as a downloadable addition to Windows XP and Server 2003, PowerShell has been significantly upgraded in 2009 (v2) with the addition of remote execution of scripts, and in 2012 (v3), 2014 (v4), and 2016 (v5). In 2018 Microsoft released PowerShell Core (v6) which was open sourced and runs cross-platform on Windows, Mac, and Linux.

4084 questions
2
votes
2 answers

How to import a text file into powershell and email it, formatted as HTML

I'm trying to get a list of all Exchange accounts, format them in descending order from largest mailbox and put that data into an email in HTML format to email to myself. So far I can get the data, push it to a text file as well as create an email…
Don
  • 838
  • 8
  • 19
  • 33
2
votes
1 answer

Setting up a very mixed Active Directory network to work with PowerShell Remote Administration

Summary: I want to be able to monitor the computers on my network, but don't need it to be automated. We're too small to purchase anything like MOM, but too big to do anything manually (~100 machines in two locations). I just keep running into…
erictheavg
  • 133
  • 6
2
votes
2 answers

Scripting help - need to get phone number of AD accounts and then add them to contacts in trusted domain

I have domain accounts that I have created as contacts in another trusted domain so that they can see them in their Exchange GAL. I need a way to extract the phone number field from UserA (user account) in DomainA and import it into UserA (contact)…
TheCleaner
  • 32,627
  • 26
  • 132
  • 191
2
votes
1 answer

Lync 2010 Group Chat Logging

My group is rolling out Lync 2010 Group Chat and it seems from the documentation that the Lync Server does not log actual conversation history for Group Chat. I find this suspect because if conversation history is enabled in a given chat channel,…
emhohensee
  • 135
  • 1
  • 7
2
votes
1 answer

Powershell Remote Execution Error on EC2

I am trying to use powershell remote execution on a EC2 server. I have enabled Windows Remote Management on the Server and configured WRM with -quickconfigure. However when run the example: $Cred=Get-Credential Invoke-Command -Authentication…
2
votes
3 answers

Powershell authentication over VLAN

Problem I'd like to enable remote powershell scripting for all workstation hosts on a VLAN. There's no Active Directory or Directory services whatsoever. So HOST A on subnet 192.168.1.x would like to query HOST B 192.168.2.x. I've already…
Bubnoff
  • 415
  • 7
  • 18
2
votes
2 answers

Exchange 2010 Powershell filter SMTP domain

How do I filter out only the SMTP address? I want to report only on users with domain name @mydomain.com. All other domain names would be excluded. I'm attempting to run a report that would exclude certain SIP/SMTP addresses based off of the user's…
Aaron Harris
  • 21
  • 1
  • 3
2
votes
3 answers

Re-give users ownership of their mapped home folders via powershell

I changed the user quota on a windows 2008 machine and after that some users reported that they were able to read but not write to their mapped home folders. If I re-enter the Home Folder path in the Server Manager and accept the default prompt…
Bourne
  • 1,039
  • 5
  • 18
  • 24
2
votes
1 answer

"Get-OwaVirtualDirectory" very very slow when accessing CAS in different site

I have a CAS server in a different AD site, and every Exchange 2010 command runs quickly... except for the one that use IIS and Get-XXXVirtualDirectory. In these cases it takes several minutes for the results to come back. Is this normal? Can I…
makerofthings7
  • 8,911
  • 34
  • 121
  • 197
2
votes
2 answers

Windows Server patch management (email notification when patch applied?)

Patch management (WSUS) hasn't been in my court until recently so I am trying to get acclimated to its functionality. So currently we are using WSUS version 3.2 for our Windows Server patch management. Something I am finding lacking with this…
Chadddada
  • 1,680
  • 1
  • 19
  • 26
2
votes
2 answers

trying to add multiple computer accounts to an AD group using powershell

I'm trying badly to add multiple existing computer accounts to an AD group and i've tried the following syntax's but none worked: Import-module ActiveDirectory foreach ($c in Get-Content c:\pacs_ws.txt) { add-QADGroupMember -identity…
Itai Ganot
  • 10,644
  • 29
  • 93
  • 146
2
votes
2 answers

Powershell unrar with wildcard

I'm trying to extract about 40 folders with each containing a rar, but I never have done in it powershell. In bash you can use */*.rar to extract them using a wildcard, but how do I this in powershell ? I tried something along C:\Program Files…
Lucas Kauffman
  • 16,880
  • 9
  • 58
  • 93
2
votes
2 answers

With powershell, how do I find out which user is running a service?

As mentioned in the title, how to find out which user is running a service with powershell?
2
votes
3 answers

PowerShell script to find Outlook duplicates

We are migrating users from Notes to Exchange 2010 using BinaryTree, somehow we accidentally migrated users twice and it created duplicate items in the user mailbox. Is there any PowerShell or VB script to check the user inbox for duplicate emails?
Selva
  • 21
  • 1
  • 2
2
votes
1 answer

Waking up web server using powershell script?

I'm building a script that perform http request in order to "wake up" some asp.net applications. The following script is working, but is synchronous : function WakeUp([string] $url) { Write-Host "Waking up $url ..." -NoNewLine $client =…
Steve B
  • 245
  • 4
  • 13
1 2 3
99
100