PowerShell is Microsoft's new scripting language in 2006, significantly upgraded in 2009 (v2), 2012 (v3) and 2014 (v4). It allows interpreted scripts based on PowerShell cmdlets and .NET primitives.

learn more… | top users | synonyms (1)

2
votes
1answer
847 views

Exchange 2007 Mailbox Cleanup - Exporting Mailboxes Script

I have been assigned a task to cleanup our Exchange server by exporting the mailboxes of users who have left the company. We want to keep a copy of the mailbox for 90 days, just in case HR or ...
4
votes
2answers
911 views

Is it possible to clear the Pager field in AD users & computer using a command?

I need to run though a list of 100 user names and clear their Pager field, can it be done with Power Shell? The input of the file name which includes the user names looks like this: itaig haruth ...
1
vote
7answers
7k views

how to get MAC address of remote computer

I have specific situation. I want to get MAC address from a remote computer, which is not in domain. I know the hostname and IP address of the remote computer. The IP Address of my computer is ...
1
vote
3answers
7k views

How can I exit a function in powershell

I have a function that I know will throw an error. This error is expected, but when it's thrown I want to end the function. I have a Trap section in my script, and I have used both the Return and ...
0
votes
1answer
77 views

EMC/Exchange Powershell not running as administrator or without correct privs

I have an AD/Exchange 2010 setup that usually works pretty well. However, after installing Outlook 2010 on the server and choosing to "remember the password" for a user who is not an administrator, ...
2
votes
1answer
236 views

Console dump of a DCOM configuration for a given GUID?

Is there a way to dump the DCOM settings for a given DCOM object on the command line, if the GUID is known? (Maybe using PowerShell)
0
votes
1answer
1k 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 ...
4
votes
3answers
4k views

Manage Windows 2003 ad domain with powershell?

Can you manage a Windows 2003 functional domain with the AD powershell modules? I have read that you must install the AD management gateway service to do this, but what if you do not have any Windows ...
1
vote
1answer
948 views

Configure anonymous authentication to use app pool identity for a specific site

Instead of flipiping the switch in the GUI to tell IIS to use the Application Pool Identity for Anonymous authentication, I'd like to do this in a powershell script. Scott Forsyth posted a solution ...
8
votes
1answer
195 views

Is there a version of the AD tools that provide the PowerShell output, similar to the Exchange tools?

The Exchange administration tools output the exact PS commands they will (or just did) execute. Is there a different version of the AD tools (primarily AD Users & Computers) that have similar ...
0
votes
1answer
493 views

Logging windows connections with netsh

I am trying to enable connection logging with netsh on Vista x64, as shown in this MSDN Article about Firewall troubleshooting... First, I enabled logging of allowed connections to ...
1
vote
3answers
3k views

Powershell Parameters

I have a Param block in my script Param ( [Parameter(Mandatory=$True)] [string]$FileLocation, [Parameter(Mandatory=$True)] [string]$password = Read-Host "Type the password you would ...
7
votes
3answers
3k views

How can we check PowerShell v2.0 is installed on a list of servers?

How can I check if PowerShell v2.0 is installed on a list of servers? The list of servers is a combination of Windows Server 2003 and Windows Server 2008. A vbscript or PS script would be wonderful. ...
0
votes
1answer
503 views

Powershell Script Scheduled Task Stopped Running (Could not Start)

I'm running a scheduled task (for Powershell Script) on Windows 2003 Server. I believe the script works fine. The task is scheduled to run every 10 minutes from 7:00am to 11:50pm everyday. However, it ...
3
votes
2answers
289 views

How to monitor a Windows process' working set greater than 4GB?

Apparently the .NET framework has a bug that prevents working set values above 2GB from accurately being determined. Between 2 and 4GB one can apply some xor-ing calculation to obtain the value, but ...
5
votes
4answers
6k views

How can I run a PowerShell function remotely?

Using powershell, I plan to run many functions on a remote host to gather information. Here is an example to retrieve the content of file remotely just by running a function called getcontentfile ...
0
votes
1answer
146 views

How to set acl on a file in remote website using msdeploy & powershell/psake

I am running a build process in powershell and using msdeploy to deploy a website to a remote server. I need to set acls on a particular file either when the site is deployed or post deployment. What ...
1
vote
1answer
269 views

Using PowerShell switch command with changing values

I am trying to use the switch command to select something out of an array. The array can change sizes depending on information from another spread sheet. For example: C:\> $Test = A C:\> ...
9
votes
3answers
7k views

How to pass parameters to a function?

I need to process an SVN working copy in a PS script, but I have trouble passing arguments to functions. Here's what I have: function foo($arg1, $arg2) { echo $arg1 echo $arg2.FullName } echo ...
0
votes
1answer
158 views

Exchange 2010: disable some functions for users via powershell

I am setting up a environment, where not all users should have access to all functions. Basically, I want some users to only have these functions: Personal mail folders Personal Contacts Personal ...
-1
votes
1answer
67 views

Automate Monitor string in different log files

I have few log files in different servers and I want to check output in the end of those log files for e.g . success: 4000 failed: 200 These logs files are getting generated daily and I have to keep ...
-1
votes
1answer
558 views

Email Power-shell Script.

I would like this script that I wrote to send an email of its output as well as display the out put in the console. I have written this but it doesnt seem work as expected. How can I make this ...
0
votes
1answer
345 views

Is there a registry key change that will by-pass the Windows Domain Join Welcome page?

I'm scripting some Windows Server 2008 R2 builds using Power Shell. Some software needs to be installed after the server has joined the domain. Since I want to automate everything, I'm looking to ...
2
votes
1answer
1k views

Removing many Exchange full access permissions on a mailbox

I'm trying to use Powershell to remove certain full access permissions on an account as part of a disable user process. I need to remove all full access permissions on the account except for: NT ...
4
votes
1answer
2k views

How to get physical partition name from iSCSI details on Windows?

I've got a piece of software that needs the name of a partition in \Device\Harddisk2\Partition1 style, as shown e.g. in WinObj. I want to get this partition name from details of the iSCSI connection ...
2
votes
1answer
5k views

How to select a user and remove all groups they are a member of using Powershell (with Quest)?

I've read quite a bit online about this and thought I had found a solution, but it doesn't seem to be working like I would expect. I am wanting to get a user based on the username I input, then ...
3
votes
1answer
569 views

Why powershell runs executables in separate window?

On one of my servers (2008 R2) powershell refuses to run executables without extension, so typing cmd (or &cmd) in command prompt results in folowing error message: The term 'cmd' is not ...
4
votes
1answer
114 views

Active Directory management with low user rights

Our problem: The client, a normal user, has to be able to reset multiple passwords at once. Around 30 in one go. This would call for powershell or something along these lines, but for AD and ...
3
votes
1answer
375 views

Powershell and NMAP Information Sharing

I am working on a project where I would like to perform host documentation for a variety of items. Part of these items would be sourced from Powershell and the rest would be sourced from NMAP. For ...
2
votes
2answers
1k views

Powershell Command to Export Sent Items Count in Exchange 2010

I'm looking to get a count of all sent items for each user in our organization. We are doing an audit of all users to find out which culprit has been sending out tons of emails, so this is why I'm ...
1
vote
1answer
306 views

Exchange 2010 Cmdlets for Sent Items in a Distribution group

Here is the scenario that I am in and am stuck on how to get this the correct way. What I'm looking for is a syntax that will provide me with statistics on what users have emailed "Sent" for the day. ...
2
votes
1answer
1k views

PowerShell Start-Job output

When I run command Start-Job {dir} in PowerShell I get output Id Name State HasMoreData Location Command -- ---- ----- ...
0
votes
2answers
106 views

What's the difference between ps processname* | kill and kill -p processname* in powershell?

In powershell, is there a difference between: ps theProcessName* | kill and kill -processname theProcessName* Thanks
-1
votes
1answer
571 views

Hi, anyone met the sending issue like this? By using powershell

My script is about sending notfication email, and it was running well on my local machine, but when I removed it to an server 2k3, the email cannot be sent out with below error log: Exception calling ...
3
votes
1answer
3k views

Querying Active Directory in PowerShell from a Windows host that is not a member of the domain

How can I use PowerShell [adsisearcher] to query a domain that I am not a member of? Usually I will do something like this: $myAdsi = [adsisearcher]"" $myAdsi.SearchRoot = ...
4
votes
1answer
1k views

Copying List of Files Through Powershell

So I'm trying to copy 44k files from one server to another. My Powershell script is: Import-CSV f:\script\Listoffiles.csv | foreach $line {Move-item $_.Source $_.Destination} With the Format for ...
1
vote
1answer
48 views

Is it possible to open an Active Director or Exchange Management Console user dialog directly from Powershell?

I'd like to be able to launch either the AD user dialog, or the EMC mailbox dialog directly from a Powershell script to open a specific user. The workflow goes something to the effect of "Does ...
0
votes
1answer
570 views

How to retrieve names of all private MSMQ queues - efficiently?

How can I retrieve the names of all of the private MSMQ queues on the local machine, without using System.Messaging.MessageQueue.GetPrivateQueuesByMachine(".")? I'm using PowerShell so any solution ...
2
votes
1answer
948 views

Exchange 2010 powershell - select custom attributes

How do I select the custom attribute from the Exchange powershell command get-mailboxstatistics? I would have expected to use something along the lines of get-mailboxstatistics -server dbserver | ...
1
vote
2answers
3k views

Exchange 2007 - How to use export-mailbox function?

I am trying to use the Export-Mailbox cmdlet to export a mailbox to PST file but i get an error that i'm running on a 64bit machine and must use a 32 bit etc etc.. I have a Windows 7 Pro 32bit PC ...
2
votes
2answers
1k views

Connect to powershell through SSH with keyexchange?

I have little experience with Windows systems. Coming from a Linux background I was wondering if there is a way that I can ssh to powershell from a Linux shell? If this is not possible, is there a ...
3
votes
3answers
331 views

Backing up Group Policy Objects and their OU Links

I realise there are multiple ways in which you can backup GPO's - via Powershell, via Group Policy Mgmt and so forth, but how in Windows are you able to backup not only the GPO's themselves, but their ...
3
votes
1answer
162 views

How do I pull counts of email sent to a specific smtp address

I was asked to see if I could pull statistics on the volumne of email, and specifically the size of attachments sent from within my organization to a particular email address. I work a lot with ...
1
vote
0answers
185 views

PowerShell script halts execution when Windows XP PC is locked

I have the following script that does a continuous ping and reports failures. It works fine, except the loop apparently "suspends" when the computer is locked. I have confirmed this by starting the ...
2
votes
1answer
524 views

Why does this PowerShell script hang?

Today I had to use Start-Sleep many times so I thought I would create a shortcut function for it, sleep($time). However, whenever I entered the function it never exits! It must be an issue with either ...
-3
votes
2answers
382 views
1
vote
0answers
353 views

Can you use SQLite 64 bit odbc from powershell

Basically, my question is "Does this combo work for anyone," and, "Can you see what I am doing wrong" I have installed 64 bit ODBC driver for sqlite, downloaded from this page. I am running ...
1
vote
1answer
291 views

How to use MS DOS-defined aliases in Powershell

I have some aliases that are defined in MS Dos style, how can I invoke those from Powershell? When I type "alias" from Powershell prompt, I can see my aliases defined there but when I try to call them ...
1
vote
0answers
340 views

Powershell: Cannot connect via SSL

Am following "secrets to powershell remoting" to setup an SLL account and seem to be missing a step. I ran Winrm create winrm/config/Listener?Address=*+Transport=HTTPS ...
2
votes
2answers
3k views

Powershell or WMI to pull Printer Properties and Additional Drivers?

What I am trying to accomplish: Use a powershell script (WMI or cmdlets directly, or a combination) to query a 2003 or 2008 server with the PrintServer role, enumerate the printers shared, then list ...