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)

3
votes
1answer
4k 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
239 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
2k 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
2k 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
163 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 ...
4
votes
2answers
20k 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
1k 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
2k 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
3k 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
763 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
71 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
1k 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
2k 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
3k 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}" , ...
2
votes
1answer
2k 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
6k 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
2k views

My PowerShell script won't save to file when running 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 is that the new file is never created/saved. ...
1
vote
1answer
232 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
433 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
2k 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
5answers
356 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
17k 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. ...
2
votes
1answer
102 views

New-ActiveSyncMailboxPolicy “not implemented” on Exchange 2007 SP3

If I try to run: New-ActiveSyncMailboxPolicy Test directly in the Powershell, it asks me if im sure, and if so, it does what it should. But if I try the same from my example Code in C#, then I get ...
-5
votes
1answer
74 views

Search under file and folders with any file extension and move them to different folder [closed]

How do I search for files with certain extensions and move them to different folder using PowerShell?
1
vote
2answers
2k views

Copy a user's organizational unit to a new user

My goal is to copy an existing user, including OU placement in the AD tree. So far i have this: $SName = Read-Host "Please Enter the login initials of the source user " $U = Get-ADUser -Identity ...
1
vote
3answers
2k views

Using command line to see if a given computer's local guest account is disabled

I need to generate a report that shows the guest account is disabled for a given list of computers. How can I use net user, powershell, or any other commonly used tool for this purpose?
3
votes
1answer
1k views

Piping Objects From Format-Table to Export-CSV Has Unexpected Results

I'm running this command to get a list of all Activesync users and export them to C:\activesync.csv Get-ActiveSyncDevice | Get-ActiveSyncDeviceStatistics | sort-object status, devicetype , ...
1
vote
1answer
1k views

Get-WinEvent only works on Vista+ as source and target?

I originally assumed Get-WinEvent cannot be executed on Windows 2003, i.e. source computer must be Vista or later OS. However, it can be ran against a Windows 2003, from a Vista+ computer. It appears ...
1
vote
2answers
93 views

PowerShell overwrites source variable when I create new concatenated variable

I have a large script that will be asking for a download directory and downloading a bunch of files into it. However, when I set the download filename string based on the directory string, they are ...
3
votes
3answers
3k views

Office365 how to recover entire dumpster

I need to recover an entire deleteditem aka dumpster folder. Using Get-MailboxStatistics User@Domain.com | Select *Deleted* I am able to see 2.2+GB of data = 9,700+ emails. How can I recover all of ...
5
votes
5answers
27k views

command line - switch to administrator mode

Is it possible to switch from normal mode to administrator mode in command line? I don't want to open command line by right clicking and selecting "run as administrator". Thanks
4
votes
3answers
7k views

Getting network interface device name in powershell

I needed a powershell 2 script to get the name and device name of each interface like it is shown in network connections in control panel. Should be easy... $interfaces = Get-WmiObject ...
2
votes
1answer
344 views

Powershell (sqlps) lastbackupdate not changing despite having run a sqlserver backup

I'm using Powershell to check last backup times across all our sqlserver databases. This seems to work really well, but I've got a question If I run this (a cut-down version of the actual script): ...
3
votes
2answers
320 views

Is it possible to get CCM Updates Schedule using Powershel or VBScript?

I want to be able to check the CCM Updates Schedule as seen in Configuration Manager Updates tab. I've been looking around on google and I've not been able to find a consistent answer to this. I ...
2
votes
2answers
7k views

Powershell script to delete sub folders and files if creation date is >7 days but maintain parent folders of sub folders and files <7 days old

I'm currently using the Powershell script below to delete all files directories and sub directories of "$dump_path" that are seven days or older based upon the creation date and not modified date. ...
3
votes
1answer
1k views

How can I systematically shut down Windows services in order?

We have this open source application that has three (3) services. For the purpose of this question, let's call them A, B, and C. Now, they have to be shut down in a specific order. That order would ...
0
votes
1answer
559 views

How do I remotely run a Powershell workflow that uses a custom module?

I have a custom Powershell module that I wrote for various tasks. Now I want to craft a workflow whose activities will use commands from the module. Here's my test workflow: workflow ...
5
votes
1answer
978 views

Powershell Registry value to be used as variable

I am looking on how to return one value from the registry. I only want the AGENTGUID value from this command. $reg=reg query "\\$computer\HKLM\SOFTWARE\Wow6432Node\Network Associates\ePolicy ...
1
vote
2answers
380 views

netsh doesn't provide commands

According to Netsh Commands for Wired Local Area Network (LAN) in Windows Server 2008 and Windows Server 2008 R2, netsh should provide commands such as netsh add profile filename="profile.xml" ...
1
vote
0answers
609 views

PowerShell Remoting: No credentials are available in the security package

I'm trying to use the following script: $password = ConvertTo-SecureString "xxxx" -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential("domain\Administrator", $password) ...
4
votes
1answer
818 views

PHP Apache XAMPP Run Multiple Scripts from CLI in Background

How can I simultaneously run dozens of PHP scripts in the background from XAMPP's command line interface? Someone suggested a batch file, but when I tried executing this: start php 1.php start php ...
3
votes
1answer
121 views

How to install remote software NOT on a domain?

I have a situation where some software (that I wrote) is going to be deployed on 60 laptops for an event. The laptops are all running windows 7, but there is no domain controller, and they will all ...
0
votes
1answer
686 views

How to add powershell script to Windows 7 Home Premium startup?

Win 7 Home Premium doesn't have gpedit.msc as you know so, how to add startup script to Windows? Start Menu entry doesn't work cause i need to have administrative rights for the script to run
0
votes
1answer
631 views

Does the powershell cmdlet add to or replace out-of-office settings in Exchange 2007?

When using Powershell to set Out-of-Office in Exchange 2007 (e.g.), do multiple commands containing -StartTime and -EndTime add to some internal list that Exchange maintains or does each successive ...
2
votes
3answers
690 views

Can I pass a multi-line string to svn in PowerShell?

I have the following line in a script: svn propset svn:externals $newExternals $path Now for the first time $newExternals is a multi-line string (there are several svn:external properties) and svn ...
4
votes
2answers
3k views

Remotely run a script invoking “Run As Administrator”

This is as close to the exact question that I have, but looks like he found another way that fits the needs so it has been marked as answered: I have a Powershell script running on server A that I ...
3
votes
0answers
10k views

List ALL Printers using Powershell

I'm having issues listing all the printers on a computer using Powershell. We have a batch script that will add/remove/list "per computer" printers using PrintUI. I can use PrintUI to list the ...
1
vote
1answer
234 views

Powershell and long-running external tools?

I'm trying to compact a MS-Access database using JetComp.exe using a powershell script. Here is the operative lines: # 4. Run JetComp LogWrite("Begin: Running JetComp") .\JETCOMP.EXE -src: $srcDB ...
1
vote
1answer
2k views

Powershell and DirectorySearch exclude OU

I have a question on how to exclude a specific OU when running this PS statement. This gives me all the servers in the Domain. I like to excluded the OU called ...
2
votes
2answers
80 views

Using PowerShell Restart-Service cmdlet with a service that has an instance name

I want to restart a service on a remote machine using PowerShell. The service has both a displayname and an instancename. Can I use the Restart-Service cmdlet to do this? I don't see an instancename ...