PowerShell is Microsoft's new scripting language in 2006, and significantly upgraded in 2009. It allows interpreted scripts based on PowerShell cmdlets and .NET primitives.

learn more… | top users | synonyms (1)

1
vote
3answers
4k views

Using Powershell's Invoke-command to install .exe on remote computer

I have an .exe I would like to install on a large farm of Windows Server 2008 computers. I am attempting to use Powershell remoting. I have this command which works locally: invoke-command {& ...
3
votes
2answers
65 views

Ensure drive is mapped at login on laptop with strictly wireless

So, $software runs on a 'server' (windows client w/ file sharing to share out the db folder), and laptop client has the drive mapped and $software also installed. This is the vendor's recommended ...
1
vote
1answer
1k views

powershell v2 remoting - How do you enable unecrypted traffic

I'm writing a powershell v2 script that I'd like to run against a remote server. When I run it, I get the error : Connecting to remote server failed with the following error message : The ...
2
votes
3answers
858 views

Exchange deferred delivery: update message “Date:” header

A client is using the "deferred delivery" feature in Outlook / Exchange. For some reason this feature does preserve the original message creation time (i.e. when the user has hit the "send" button) as ...
3
votes
1answer
55 views

Configure and monitor Windows 2012 DHCP server with Powershell

We've recently been working with the documentation here to set up some access policies for a new DHCP server. I've been able to successfully import 600+ records with the Set-DhcpServerv4Policy -Name ...
1
vote
1answer
29 views

What happens to active connections to my SQL Server DB if I back up the transaction log with the NORECOVERY option?

Some background: I'm migrating my SQL Server DBs to a new machine and I wrote a few Powershell scripts to send/apply full backups and transaction logs asynchronously to the new server, but my question ...
2
votes
2answers
88 views

PowerShell Import DnsShell Module

So here's the list of available modules in this directory. As you can see DnsShell is there. PS C:\windows\system32> Get-Module -ListAvailable Directory: ...
0
votes
0answers
39 views

Powershell deploment script into multiple 2003 windows servers

I have created a script "test.ps1" that runs security checks on folders within machines. Now I want to deploy this script into 70 windows servers so it can run these security checks on all of them. ...
4
votes
1answer
1k views

Why do weekly tasks created via PowerShell using a different user fail with error 0x41306

We have some scripts that create scheduled jobs using PowerShell as part of our application. When testing them recently, I noticed that some of them always failed immediately, and no output is ever ...
78
votes
8answers
70k views

How to zip/unzip files in Powershell?

Is there a one-liner that will zip/unzip files (*.zip) in PowerShell?
2
votes
1answer
128 views

Can't shut down HyperV VM with Powershell despite admin rights

I am attempting to use a script that shuts down my Hyper-V VMs, copies their VHDs to a target share, then boots them back up. I found the script on spiceworks just a couple days ago. I always receive ...
5
votes
2answers
146 views

How to print out information about Task Scheduler in powershell script?

I am trying to print out information from the Task Scheduler from the local computer in a PowerShell script so other users can print out this information as well and not have to access the Task ...
1
vote
3answers
1k views

Powershell - How to launch Explorer.exe with path \\server\c$ (different credential)

The Context: Powershell launched as a domain admin. From this Powershell window, Is it possible to open c$ of a remote box (\server\c$) in explorer.exe without asking for credential (using the ...
0
votes
1answer
387 views

Cluster Aware Updating set up - VirtualComputerObjectName ignored

I am trying to set up Cluster Aware Updating, but it always fails with the following error: Add-CauClusterRole : Unable to create the CAU clustered role because a Network Name resource could not be ...
5
votes
1answer
3k views

Purge print driver cache on windows 7 with powershell script

[Background] We have been having trouble with our network clients suddenly being unable to print. They get an odd error with a hex code. We determined that something in the driver was messed up and ...
8
votes
4answers
8k views

How to properly add .NET assemblies to Powershell session?

I have a .NET assembly (a dll) which is an API to backup software we use here. It contains some properties and methods I would like to take advantage of in my Powershell script(s). However, I am ...
1
vote
1answer
81 views

Error 0x8007007e When trying to mount WinPE 5 wim in Windows 7 using Powershell

Using ADK for Windows 8.1, and the DISM cmdlets that come with them. I have WMF 4.0 installed. My machine is Windows 7 x64 SP1, and I'm trying to mount the wim using PS C:\Users\BigHomie> ...
1
vote
3answers
519 views

Trigger Powershell Command to Copy SQL Backups to Network Drive

I've got two servers on a workgroup and I need to transfer my SQL Server 2008 Backups from the local drive of one to a network drive on another. Ideally, I'd like to have SQL call the Powershell ...
1
vote
2answers
186 views

Executing a git command using remote powershell results in a NativeCommmandError

I am getting an error while executing a remote PowerShell script. From my local machine I am running a PowerShell script that uses Invoke-Command to cd into a directory on a remote Amazon Windows ...
2
votes
1answer
39 views

How do I set “CustomAttribute6” for a regular AD user?

I'm trying to set AD attribute 6 in Powershell to update a user who has no mailbox, and isn't an exchange contact; and is only an AD user ObjectClass : user The command I'm using is: get-adobject ...
2
votes
2answers
83 views

It cannot determine the content type of the HTTP response from the destination computer wsman

I am trying to connect to an Exchange server via a wsman connection using PowerShell. The client server in question is in a Workgroup, while the Exchange server is in its own domain. I use the ...
1
vote
2answers
838 views

Getting custom web.config sections and their contents in Powershell

I have a web application installed in c:\inetpub\wwwroot_Site1\AppName which has a custom section group and section as follows: <configSections> <sectionGroup name="Libraries"> ...
0
votes
1answer
979 views

How do I make ncat not send a line-feed?

I'm on Windows 7 Powershell and have ncat from http://nmap.org/ncat/ I'm trying to send "foo" to some network device PS> ncat -u 192.168.1.255 6061 foo but it sends "foo\n" (66 6f 6f 0a) and ...
2
votes
2answers
83 views

How do I combine two Powershell outputs so that command #2 is run on each output?

I want to combine the commands Get-user and get-casmailbox so that I can get the "Company" from the first output, and the "ActiveSyncStatus" in the latter into a single output. I also understand that ...
0
votes
1answer
81 views

Powershell Script not working

I have this scripts that should move Computers based no their subnet, but I keep on getting the following error and I can't for the life of me find the problem. I can manually move computers using ...
3
votes
3answers
240 views

PowerShell script that should find disabled users that are not in a specific OU outputs users from that OU as well

Hey I've got this cmdlet here: Get-ADUser -filter {(distinguishedName -notlike "Disabled Users") -and (enabled -eq $false)} -searchBase "ou=FirstOU,dc=domain,dc=com" I've built it to find disabled ...
0
votes
2answers
51 views

non-GUI connection to local Hyper-V VM without network

I have a virtual machine on Hyper-V manager (Windows 2008 R2) without a network configured on the VM. From a powershell script running on the host Windows server, I would like to query into the OS of ...
2
votes
2answers
123 views

How can I set an arbitrary (non default) attribute for an AD user or AD Contact?

I have AD Users, or contacts that are not Exchange Mailbox users, or contacts. I also have a SSO system (Ping Identity... technology similar to Microsoft ADFS), where it leverages the AD Schema ...
1
vote
3answers
174 views

How can I disable a scheduled task using Powershell?

I have a web application that runs on Windows Server 2008 R2, which has a large number of scheduled tasks which take care of all the backend stuff. When I do a software deployment which touches the ...
4
votes
4answers
163 views

powershell vs GPO for installation, configuration, maintenance

My question is about using powershell scripts to install, configure, update and maintain Windows 7 Pro/Ent workstations in a 2008R2 domain, versus using GPO/ADMX/msi. Here's the situation: Because ...
3
votes
1answer
207 views

PowerShell - Finding all of users' group memberships and kicking it out of them

as title says, I have to find all the groups that the user is a member of, and deleting its membership from all of them. I've tried this: get-adgroup -filter * | where {(Get-ADGroupMember $_ | ...
1
vote
1answer
47 views

Trying to list out Web services, Web sites, and App Pools - Windows Server 2003

I am curious on how i would list out Web services, Web sites, and App Pools to a .txt file on a Windows Server 2003 machine. I have Powershell 2.0 configured and have been trying to run some scripts ...
1
vote
2answers
81 views

PowerShell - finding users who are Inactive AND not disabled

I wrote this cmdlet: Search-ADAccount -filter {(enabled -eq $true)} -Users Only -SearchBase "ou=FirstOU,dc=domain,dc=com" -AccountInactive -TimeSpan 30 But it outputs an error: Search-ADAccount : ...
1
vote
2answers
172 views

PowerShell - Limit the search to only one OU

Ive got this cmdlet and I'd like to limit the results to only one OU: Get-ADUser -Filter {(Enabled -eq $false)} | ? { ($_.distinguishedname -notlike '*Disabled Users*') } Now Ive tried to use ...
1
vote
1answer
74 views

Turn Windows Features on or off, Windows 8, Windows Batch File

I am looking to produce a batch script that turns on a number of Windows Features as the same routine is currently performed on multiple machines, an example of this would be... Turn on Default ...
0
votes
1answer
81 views

script to list user's mapped drive not giving results or error

We are in the process of migrating two file servers to a new server. We have mapped drives via user group in group policy. Many users have manually mapped drives and we need to find these mappings. ...
0
votes
1answer
68 views

Delete files except ones created on sundays with in last 4 weeks

I have a script that copies some files around and deletes older files from destination. right now it just deletes everything older than 10 days. to increase backup retention we need to keep files that ...
8
votes
2answers
389 views

Detecting AD Site options using PowerShell

How can I use PowerShell to find AD site options like +IS_INTER_SITE_AUTO_TOPOLOGY_DISABLED in PowerShell? I've been playing around with the following command, but can't get it to spit out anything ...
3
votes
3answers
4k views

How to enable volume shadow copy using Powershell?

How to enable volume shadow copy on specific drive (D:, E:,...) and set up schedule using Powershell ? I just need some hints how to start.
0
votes
1answer
23 views

Powershell waiting for more parameters when asking for all users from a specific OU?

I want to get all the users from OU "myusers" so I have this cmdlet right here: get-aduser -filter * -searchbase"ou=myusers,dc=domain,dc=com" But when Im running it, powershell prints a >> ...
1
vote
3answers
331 views

Virtual Machines List from PowerShell vs PowerShell ISE and PowerGUI

I am confused to why I have different information based on where I try to retrieve it from. I have 3 Windows 2012 servers (G0, G1, and G2) running Hyper-V. The following situation is captured from one ...
1
vote
2answers
67 views

How do I install and use the cli53 tools on Windows?

I'm trying to find the simplest way to import a large number of BIND zone files in to Route 53. I've had a quick look at the AWS CLI and AWS Tools for Windows PowerShell but they don't seem to include ...
2
votes
1answer
65 views

How to setup a daily report of the top e-mail senders in Exchange 2010

We have had issues with compromised Exchange accounts sending a large amount of unsolicited e-mails out. We have mitigated this by using a cloud e-mail gateway that does a better job in detecting ...
2
votes
1answer
48 views

How to set RDS security layer in Windows Server 2008 R2 via PowerShell

I'm looking for a way to set security layer setting in Windows Server 2008 R2 RDS via PowerShell (other ways to do in programmatically will do also but PowerShell is preferable). Via GUI it can be set ...
0
votes
1answer
59 views

Powershell - check if all users in a specific OU are disabled, disable if not

I tried to search for it but I didn't find anything. Could someone help me out with an example of a script that would do this?
0
votes
0answers
175 views

Idempotent Powershell word search/replace across documents with headers, change tracking, etc

I've found one or two guides to doing a word search and replace across multiple documents with powershell. They work well on simple documents. However, the script ignores text in headers and ...
0
votes
0answers
144 views

“powershell has stopped working” on PS exit after creating IIS User

On a Windows Server 2012 box, I'm using PS to create a new IIS User (for automated deployments using MSDeploy). The command itself appears to work fine -- the user is created -- but as soon as I exit ...
1
vote
0answers
190 views

RDS installation failure on 2012 R2 Server Core VM in Hyper-V Server

I'm currently installing a test-bed for my firms Infrastructure replacement. 10 or so Windows/Linux servers will be replaced by 2 physical servers running Hyper-V server. All services (DC, RDS, SQL) ...
2
votes
1answer
37 views

Execute ps1 script when CPU threshold is meet

I'm looking for a function similar to Debug Diagnostics Collector. Where you can setup a performance (or any counter) trigger (eg. above 50% CPU over 50 seconds). Once condition of a trigger are ...
-1
votes
2answers
147 views

How to change default install path for Notepad++ in Powershell silent/unattended script

I cant figure out the parameter(s) to change the default install path C:\Program Files\ of Notepad++ to the drive I want it to install to when I run my PowerShell script. I am trying to do a silent ...