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, ...

learn more… | top users | synonyms (1)

4
votes
1answer
2k views

Use the DFSR Module on a Windows 2012 R2 Server Core

I have a standard Windows 2012 R2 box setup with server core. I have the file server roles installed along with DFSR. I want to use the powershell tools like Get-DfsrState and other Get-Dfsr* to ...
4
votes
1answer
97 views

Look on all server desktops for outstanding files before deleting profiles

We have about 70 servers that we are in the process of moving into a domain environment, so we are converting our users from local accounts to domain controlled accounts. How can we determine which ...
4
votes
1answer
180 views

My PowerShell $profile path has no $HOME prepended

I have PowerShell installed on two different Server 2008 R2 systems. On one system, $HOME is prepended to $profile, but on the other nothing is prepended: Server 1 (PowerShell 2) PS C:\> echo $...
4
votes
1answer
2k views

Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps'

I've tried reinstalling SQL Server 2014 and I'm still getting the following error message when trying to import-module sqlps. The same registry key exists, but is appended with 120. I'm able to use ...
4
votes
1answer
897 views

PowerShell: Copy-GPO failing with HRESULT: 0x8007000D

While trying to run the Copy-GPO cmdlet to copy a Group Policy Object using a predefined Migration Table I am receiving this exception: System.Runtime.InteropServices.COMException (0x8007000D): The ...
3
votes
1answer
51 views

Windows Server firewall track connection state

I am trying to control a Windows Server 2012 (R2) firewall by using PowerShell commands (see https://technet.microsoft.com/en-us/library/hh831755.aspx#BKMK_ProfileGlobalDefaults for example and ...
3
votes
1answer
71 views

Trying to use powershell to selectively erase old backup files

I am working with a drive with thousands of backup files, many of which are just cluttering space. The program our employees use creates a backup of a spreadsheet every time they open one for editing....
3
votes
1answer
148 views

Exchange Online Powershell Dynamic Dist. List of Contacts

We have Exchange online with Office 365. I am trying to set up a dynamic distribution list of external mail contacts if their address contains a certain email domain. I have tried the powershell ...
3
votes
1answer
182 views

How to do proper error handling in a push setup?

I am currently building a lab environment to get a feeling on what DSC can accomplish and where the limits are. We have a requirement to push out one-shot configurations to group of nodes based on ...
3
votes
1answer
339 views

Move-Item command only partially succeeding

I'm running a simple script to archive SMDR logs using Windows Server 2008 R2's Task Scheduler. The last line of the script is as follows -- dir c:\smdr -Filter *.txt | where-object {$_.basename -eq ...
3
votes
1answer
885 views

updating drive mapping GPO programmatically using powershell

I have a Group Policy in a domain that have lots of drive mapping settings. I would like to change the path for a lot of these servers in this gpo with powershell if possible. I know i could do this ...
3
votes
1answer
953 views

Manipulating IIS7 Configuration with Powershell

I'm trying to script some IIS7 setup tasks in PowerShell using the WebAdministration module. I'm good with setting simple properties, but am having some trouble when it comes to dealing with ...
2
votes
1answer
94 views

Exception when running PSExec on remote computer

Running this command $processesToSpawn = 3 for($i= 1; $i -le $processesToSpawn; $i++){ psexec \\computername -i 2 -u "username" -p "password" "c:\myapp.exe" } Produces the ...
2
votes
1answer
592 views

Get AD Group Member - Different Domains

I've been tasked with exporting the members of a few AD groups to .csv which I've always done in the past using the Get-ADGroupMember command in powershell, specifying the group name, selecting the ...
2
votes
1answer
248 views

How do I find IIS web application dependencies using powershell and webadministration on Server 2012

Wondering if someone can help with this. I have a number of servers that host IIS 7.5 and IIS 8.5 web application of various types. As these are production web applications and servers i can't ...
2
votes
1answer
112 views

How to properly deploy internal self-signed scripts (Powershell)

Completely new to certificate usage so be gentle. I'd like to deploy Powershell scripts that I made to other employee computers so they can use them, but I will need to sign them in order for them to ...
2
votes
1answer
276 views

remote Powershell script Scheduled task

I am having trouble running a Powershell script as a scheduled task. The script remotely logs into two Hyper-V hosts, queries the replication status and emails the result back to me. The script works ...
2
votes
1answer
128 views

Powershell v1 Search String from Variable

I am trying to search a variable which holds a list of files, gotten from get-childitem, and list all matches to a specific search string but can't seem to get the result I want, what am I doing wrong?...
2
votes
1answer
2k views

Identifying mailboxes with corruption Exchange 2013

We're preparing to rid ourselves of Exchange on-premise and are migrating from an outsourced hosting provider to go to Office 365. We're running a fully patched version of Exchange 2013, atop Server ...
2
votes
1answer
269 views

Create shared folder on share automatically

I know there is a group policy where I can map a specific share. What if I want the group policy to create a folder on that share and map it during log on? I know there must be a way to do this in ...
2
votes
1answer
229 views

How to Automatically Tust Auto Enrolled Code Signing Certificates

In my organization all developers are setup to be granted a Code signing certificate via Auto Enrollment. Additionally, PowerShell is configured by group policy to require all scripts to be signed. ...
2
votes
1answer
801 views

Get-Cluster cmdlet fails when using -Name param

Summary When I call Get-Cluster powershell returns the name of my cluster. For simplicity sake, lets call it Cluster1. If I call Get-Cluster -Name Cluster1 it fails with an error. Error: Get-...
2
votes
1answer
419 views

Running Get-MessageTrackingLog as a job in Powershell

I'm trying to create an Exchange 2010 script that will search each transport server as a job. I try the following: $transportserver = get-transportserver foreach ($ts in $transportserver) { $...
2
votes
1answer
469 views

NRPE (Winrpe) Powershell Command - Unable to read output in Nagios

I'm trying to run an Powershell script from NRPE.cfg and get the output in Nagios. When i run the script on the local (Windows) server, everything is just fine. But when i put it in the NRPE.cfg en ...
2
votes
1answer
933 views

cUrl for an HTTPS address/domain times out unless previously accessed from browser

I've lost a couple days to this problem and hope it sparks a thought from someone. I am integrating several systems together using Powershell scripts. One of the two services I am connecting to (...
2
votes
1answer
684 views

Running New-RDSSessionDeployment Remotely

I'm trying to script the setup of a remote desktop deployment into Azure. I'm using Powershell remoting to connect to the WinRM endpoint on the VM's and execute remote Powershell. For the most part ...
2
votes
1answer
482 views

Cannot Create InboxRule on one individual mailbox

This one user when trying to create a rule through outlook throws the generic "One or more rules cannot be uploaded to Microsoft Exchange and have been deactivated. This could be because some of the ...
2
votes
1answer
429 views

MSSQL Server 2012 Scheduled PowerShell Job fails

I have a simple PowerShell script that runs fine from the console (PSVersion 2.0). $psftpPath = "C:\Program Files (x86)\PuTTY\psftp.exe" $sftpHost = "foo.baa.com" $userName = "myusername" $...
2
votes
1answer
816 views

Reauthenticate a Remote Connection via PowerShell Script

I have a PowerShell v1 script that connects to a remote server via UNC path. After a reboot, authentication is needed because Windows apparently will not remember so the script cannot connect to the ...
2
votes
1answer
50 views

Alternative for Obsolete -VhdDestinationPath Parameter

I am trying to import a virtual machine with PowerShell and I want to specify which folder the VHD file should be placed in. According to http://technet.microsoft.com/en-us/library/hh848495.aspx the -...
2
votes
1answer
328 views

add certificate to all files in EFS-folder with script

I try to set up collective access to EFS-folder. I want to add certificates of all users to all files in folder. Is it posible do with using powershell scripts or some another way? Thanks.
2
votes
1answer
191 views

Restore more than 250 files using DPM 2010 and PowerShell

I've got what should be a fairly simple task: restore the following files from DPM: D:\inetpub\wwwroot\*\index.* I followed the instructions in this TechNet wiki and pretty much thought I had it. ...
2
votes
1answer
251 views

Dynamically add Server 2008 NLB Nodes

I have a small NLB cluster for Terminal Servers. One of the things we're looking at doing for this particular project (this is for a college class) is dynamically creating Terminal Servers. What we'...
1
vote
1answer
41 views

Writing a script to find what computer a user is logged into

So I want to specify a username and return the computer name. When I run this, it tells me that my $computers obj is null. Why would $computers = Get-ADComputer | where {$_.accountdisabled -eq $false}...
1
vote
1answer
72 views

Script for user movement based on OU

Any script which will read the department attribute of users (under an OU and sub OU's) and move them to different OU named as department ( already created OU structure name same as their department ...
1
vote
1answer
68 views

How to find out IE's Proxy settings for all users on a server (i.e. Windows 2008R2)?

I am trying to pull this information with the following below powershell script but it is only fetching the information for my profile and not all the users that have logged in to the server. Am I ...
1
vote
1answer
51 views

Delay when creating mailboxes in exchange

I've been creating mailboxes for some of our existing users who don't have their own mailbox so I've written a little script to make things easier for myself. Relevant extract below. $exchange = New-...
1
vote
1answer
114 views

Powershell module 'servermanager' not found on Windows 10

I am running windows 10 on a virtual machine and I would like to list the windows feature available by running the following commands on powershell: Import-Module ServerManager Get-WindowsFeature ...
1
vote
1answer
71 views

clamav: cannot scan from a file list on Windows?

salt win8 grains.item osfullname win8: ---------- osfullname: Microsoft Windows 8.1 Enterprise Evaluation salt win8 cmd.run shell='powershell' '& "C:\\Program Files\\ClamAV-x64\...
1
vote
1answer
129 views

Associate a Public IP in an Azure Resource Group to a Web App?

I'm playing around with Azure Resource Groups. I've created a group, and in it, I've created a web app. (This is all just academic and I'll delete it all when I'm done leaning, so I don't mind ...
1
vote
1answer
63 views

Remotely change local group policy server 2008R2

I'm trying to find a way I can edit the 'trusted hosts' list under local group policy remotely. Path from within Local Group Policy is: \local computer policy\computer configuration\administrative ...
1
vote
1answer
192 views

Wevtutil equivalent for powershell script to get event logs

I have made a powershell script which is as below but since I won't be able to save it in .evtx format. I want the wevtutil equivalent(using wevtutil epl) for the same.Please help! $ErrorTime=Get-...
1
vote
1answer
179 views

The term 'New-RemoteMailbox' is not recognized as the name of a cmdlet

Trying to create the new remote mailbox for O365 (on-premis mailox does not exists). I'm establishing connection to local Exchange server (either by EMS or by Invoke-Command PowerShell) and try to ...
1
vote
1answer
69 views

Cannot expand the folder

Boss wants access to all staff mailboxes (31 users). I've added full access permissions for each mailbox via powershell: Add-MailboxPermission -Identity "STAFF" -User" "BOSS" -AccessRights ...
1
vote
1answer
112 views

Add Startup and shutdown scripts to Local Group Policy using Powershell

I am trying to automate adding startup and shutdown scripts to Local Group Policy (gpedit.msc). One solution is to write to registry directly as pointed out in http://ccm.net/faq/3358-execute-a-script-...
1
vote
1answer
86 views

Find certificate file expiration with powershell

I know how to do this normally, but the problem is all of the certs in question are not installed on my local machine. I have a source control directory where they all sit, and I need to iterate over ...
1
vote
1answer
36 views

Strange e-mail behavior in powershell

I'm adding a new powershell piece into my user creation, which is to e-mail their supervisor with an alert that they have been created. However, for some reason, it sends the credentials to the next ...
1
vote
1answer
121 views

Powershell Process watchdog

I'd like to know if there is way to create some kind of watchdog using power shell, that monitors specific processes and if they hang the watchdog should try to restart them and send and email if it ...
1
vote
1answer
115 views

Run Command from Powershell file

I am getting below Error. while running command by copying from Powershell file, this file i have opened in notepad, than I am running this command by copying and than pasting in Powershell prompt. ...
1
vote
1answer
148 views

New-ADGroup with Multiple -OtherAttributes?

Keep getting "The Paramater is Incorrect" I think im following microsofts method correctly but its not working, any help is greatly appriciated. New-ADGroup -DisplayName $name -...