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)

8
votes
1answer
2k views

Unzip File With Powershell in Server 2012 Core

I need to unzip a file with powershell. The typical way I've seen everyone do this is by automating the shell with a script. $shellApplication = new-object -com shell.application $zipPackage = ...
3
votes
1answer
574 views

Powershell deleting files with regular expressions

I have several thousand files of different revisions in a folder. ACZ002-0.p ACZ002-1.p ACZ002-2.p ACZ051-0.p ACZ051-1.p ... The revision is always the last digit before the dot. I need to preserve ...
4
votes
2answers
1k views

How to find last login user on given computer name on AD

If anyone could help, it would be appreciated. I am trying to audit the network. I have list of computers that are active in last 3 months in domain. I have little script that run when user login to ...
2
votes
0answers
575 views

Powershell and sharepoint and updatelistitems() exception

I've got an issue where I keep getting "Exception calling "UpdateListItems" with "2" argument(s): "Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown." whenever I ...
1
vote
2answers
3k views

Exchange - get age range of items using Powershell

We are going to be implementing personal archives for Exchange in our organization. For us to get a good grasp on how much space is needed, we need to get an idea of the age of items that we ...
2
votes
1answer
419 views

Powershell Script to help archive company email

I am attempting to use powershell to gather emails that pertain to a certain subject, so that these correspondences might be turned over to a legal department. I am having a couple of issues here that ...
0
votes
1answer
1k views

Last computer account password change via Powershell

Does anybody know how to get last computer account password change for all servers in a domain via powershell?
0
votes
1answer
874 views

Get the Cluster Owning node name using powershell

Cluster Resource "Cluster Disk" fetching the data Listing status for resource 'SQL Server (CLUSTER)': Resource Group Node Status Cluster Disk ...
1
vote
2answers
2k views

Powershell delete files only from directory

I'm trying to delete all files (but not directories) in D:\MyTemp folder, I've tried: Remove-Item "D:\MyTemp" Remove-Item "D:\MyTemp\*" However, when I check, all the files are still there. What am ...
1
vote
2answers
3k views

Powershell - how to set multiple action on get-aduser “dataset”

I'm trying to run a script that modify password for multiple AD user accounts, enable the accounts and force a password change at next logon. I use this code but that's not work : Get-ADUSER ...
3
votes
2answers
675 views

Exchange PowerShell in a Scheduled Task runs forever

I have a couple of Exchange 2010 PowerShell scripts that I'd like to run as Scheduled Tasks. If I launch PowerShell using "Run as different user" I can run the scripts and they execute correctly. If ...
0
votes
1answer
333 views

Powershell Directory.Name return the trailing separator?

I'm writing my first powershell script: foreach ($UserDir in Get-ChildItem -Path $NetworkLocation) { # if the item is a directory, then process it. if ($UserDir.Attributes -eq "Directory") ...
2
votes
0answers
359 views

Setting a VM boot CD via PowerCLI

I have a sneaking suspicion that this may be a bug, but I'm definitely willing to entertain the possibility that I'm doing things wrong. I have a VMware virtual machine in $vm, and I'm trying to ...
0
votes
2answers
512 views

Getting users LastLogonTime on Live@edu using powershell

I am trying to get a csv file of all users in a Live@edu environment with a LastLogonTime, but I am having some issues here is my script: foreach ($i in (Get-Mailbox -ResultSize unlimited)) ...
10
votes
2answers
2k views

Should I use semicolons at the end of each PowerShell statement? [closed]

I've done a fair bit of programming in C#, but then I've also written a lot of T-SQL scripts. C# requires semicolons, and T-SQL and PowerShell they're optional. What do you do for PowerShell? Why? My ...
0
votes
1answer
674 views

Transferring DHCP using Windows Server Migration Tool - Why is Powershell is crashing on the import of the .mig file?

I am migrating DHCP from a windows server 2003R2 DC to a Windows Server 2008R2 DC I've followed this video and its predecessor (Installing Windows Server Migration Tools) ...
0
votes
1answer
235 views

PowerShell in SQL Server 2008 R2

In SQL Management Studio there is an option to start PowerShell via right-click on a database (for example). However, I cannot run queries from that PowerShell session because, it claims, the login ...
0
votes
1answer
3k views

How to get cluster information remotely via Powershell?

I've been trying to find a good way to gather various pieces of a windows cluster setup remotely, preferably via WMI, as we are not yet at a point where Powershell remoting is implemented (and I know ...
0
votes
1answer
772 views

Remote Administer Local Groups with PowerShell and WMI

How do I administer local groups on a remote server with PowerShell and WMI? For example, I would like to add and remove domain AD groups from the "Remote Desktop Users" group. This article provides ...
0
votes
1answer
1k views

How can I run an elevated powershell script as part of VMWare Customization Specification?

Background / Goal I have a VMWare template that I am deploying and I am using VMWare's "customization specifications" to perform many of the sysprep tasks. The last thing I need to accomplish is ...
1
vote
0answers
432 views

IIS Application Request Routing(Monitoring and management) Powershell

I am working with iis arr powershell... In my iis i have one web farm and in that i have two servers "server1" & "server2"...... My task is Make server1 unavailable gracefully restart server1 ...
2
votes
1answer
664 views

How do I get a list of all iPhone users who use Activesync

It appears that IOS6 users have an issue with meetings that are randomly being cancelled and one fix may be to not ask users to upgrade. How do I get a list of affected IOS users (not android or ...
0
votes
1answer
524 views

How can I get a list of default documents in IIS using PowerShell?

I'm managing a Server Core machine and trying to do everything in PowerShell, which is fun. I need a list of the default documents. From other websites, I've found out how to set and remove them, ...
15
votes
8answers
6k views

Method to integrate Powershell scripts with non-Windows workflow?

I love the smell of new machines in the morning. I'm automating a machine creation workflow that involves several separate systems across my infrastructure, some of which involve 15 year old perl ...
1
vote
3answers
4k views

Get OS architecture remotely via PowerShell

Does anybody know how to grab OS architecture remotely from multiple Windows hosts via PowerShell?
3
votes
1answer
468 views

Make server unavailable gracefully using Powershell in ARR

We are using ARR as reverse proxy and I would like to make a server unavailable for various reasons. How can this be done using Powershell? Edit 1: I found this ...
2
votes
2answers
543 views

A Powershell script which runs on a list of computer accounts and sets the security -> permission : “Allowed to authenticate”

As the topic says I'd like to automate the process of running on all computer accounts in my domain and setting this option to enabled otherwise people are unable to log into the servers using RDP. ...
3
votes
3answers
7k views

Why does PsExec hang after successfully running a powershell script?

The script is fairly straight forward. Simply tries to start a bunch of windows services. Execution locally works fine when on the target machine. The script is actually executing fine as well when ...
3
votes
1answer
2k views

How to use new-smbshare with Powershell 3.0 on Windows 7?

I installed Windows Management Framework 3.0 on a Windows 7 machine and tried to use the New-SMBShare cmdlet but when I ran get-command new-smb*, no cmdlets were found. How can I use this new cmdlet ...
1
vote
0answers
153 views

Modifying Authentication on web application / service in IIS(7/.5) via Powershell

I am trying to install a wcf-servce by using New-WebApplication in powershell. It works fine. However, how can I Modify the Authentication? I want to enable Anonymous Access Authentication and disable ...
1
vote
1answer
919 views

Is it possible for a Powershell script to return the Last Run Result from Windows 2008 task scheduler?

I've setup a scheduled task on a Windows 2008 Server with two actions. The first action is to run an application which connects to a SQL database and generates XML files. The second action is to run a ...
4
votes
1answer
1k views

Using PowerShell, in Active Directory, how would I change all the DNS A records that have a given IP to a new IP?

We've been moving data centers and I have a lot of old records that were not correctly but in DNS as CNAME records, but A records that have a direct IP (e.g. 192.168.100.n) and they're all moving to a ...
1
vote
1answer
146 views

legitimacy of the tasks in the task scheduler

Is there a way to know the source and legitimacy of the tasks in the task scheduler in windows server 2008 and 2003? Can I check if the task was added by Microsoft (ie: from sccm) or by a 3rd party ...
3
votes
2answers
9k views

Receive total send and received emails Exchange 2010

We are using Exchange 2010. I would like to retrieve a list of total sent emails and received emails from all users in the work place for 30 days. The list should have all the users' names, then total ...
1
vote
1answer
622 views

Obtain device driver version and associated GUID using PowerShell?

Right now, I am getting two separate objects A Win32_NetworkAdapter WMI object A Win32_PnpSignedDriver WMI object In my previous scripts, I've made sure I was calling separate objects, and ...
1
vote
1answer
1k views

Exchange 2010 PST-Export fails

I'm horribly failing at exporting Exchnange Mailboxes to PST files. Perhaps You are able to help me? The System I'm running some legacy machines here. The one I'm currently working on (CurrentDC) is ...
6
votes
1answer
2k views

PowerShell 3.0 x64 bit broken after installing KB2506143

I have searched using all kinds of variations on relevant terms and I cannot find a single other instance of someone else having this excact same problem, so I am hoping someone here may have a clue. ...
2
votes
1answer
469 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 ...
0
votes
1answer
70 views

Using Powershell to migrate folder rights to another server [closed]

I am interested in finding Powershell scripts that can be used\tweaked to migrate folder permissions across servers\environments. Is this a feasible approach? I would like to automate our deployment ...
1
vote
2answers
676 views

New-MoveRequest - How to assign -TargetDatabase dynamically

I am in progress to migrate (approximately) 5000 mail-objects and I need a way /script /command that will allow me to utilize the New-MoveRequest CMD-Let in combination with the possibility to ...
1
vote
2answers
1k views

Get detailed network adapter information using PowerShell

Is there an alternative to Get-NetAdapterRss that can be used on Windows Server 08/03/etc.? I'm looking to query NIC information from servers with a powershell script, but cannot seem to find how to ...
1
vote
3answers
2k views

Why does powershell -command “Restart-Service Tomcat6” fail when run from a Scheduled Task?

I get the following error in the Scheduled Task history when I try to run a task: Task Scheduler successfully completed task "\Restart Tomcat" , instance "{264b4620-5f3b-6c5f-a6cb-1625a7fa57de}" , ...
1
vote
1answer
344 views

Powershell: Call one remote script from another remote script

I inherited some code where one script references another like this: #Script1.ps1 param($arg1) # do some stuff # call script2 with argument from script1 .\script2.ps1 $arg1 #script2.ps1 ...
5
votes
3answers
3k views

Powershell: Execute exe on remote server and capture output

I am trying to script the execution of an installer on remote web servers. The installer in question is also a Windows Service that hosts NServiceBus. If RDP'd into the server, the application is ...
2
votes
2answers
941 views

My powershell script wont save a file when run using Task Scheduler, do I need to specify a specific argument?

I have a script that downloads a temporary Excel file, copies parts of it to a new file, and saves it to a specific location on the network. The problem I'm having is that the new file is never ...
1
vote
1answer
173 views

How to dump certificate file from installer via command-line?

I'm building a script that will download and install a bunch of programs. One of those programs depends on a virtual driver, which needs its certificate to be imported in order to function. Normally, ...
4
votes
1answer
309 views

I'm looking for a robust way to determine if a service can be stopped or killed

I'm looking for a robust way to determine if a service can be stopped without data loss or corruption, or if a regular stopping will work if the service can be killed via powershell. I thought about ...
0
votes
1answer
737 views

Best practive to verify IIS or a ISS website is up?

We have an internal IIS server that hosts several websites that redirects to external hosted web applications. Occasionally people will do nutty things like restart servers, stop services, unplug ...
4
votes
4answers
198 views

Get filename in the case stored on disk?

I have a file README.TXT. If I issue the following command: PS> Get-Item ReadMe.txt ...then it returns "ReadMe.txt". I want to find out the actual name of the file on disk, including case. How ...
7
votes
2answers
6k views

Server 2012 Server Core powershell not installed

In server core, after a restart powershell was all of a sudden not installed, what do I do to reinstall it? I do not have remote administration set up yet so I cannot use that to re-install it. ...