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)

0
votes
1answer
58 views

Exchange Powershell Export to pst size

I'm using exchange powershell to export exchange mailbox to pst. I'm using this command: New-MailboxExportRequest -Mailbox user -FilePath [path] This works but one user was 30GB and each ...
2
votes
1answer
95 views

-ErrorAction SilentlyContinue not working

I'm working with powershell I'm calling a script from c#. I'm trying to copy logs from different servers, foreach($server in $args) { $destination = "\\$server\$path" if(!(Test-Path ...
3
votes
1answer
41 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 ...
1
vote
1answer
42 views

Test impact of DSC script using vNext in Release Management

Following the examples on the web, it's not hard to set up a working example for the first DSC script. However, I need to find a way to just list the changes that the script will make, not actually ...
1
vote
1answer
47 views

What's the “supported” way of using Exchange PowerShell cmdlets in a script?

From what I've read, Microsoft doesn't support using the Exchange PowerShell cmdlets from anywhere but the Exchange Management Shell. However, surely people need the ability to script things and run ...
0
votes
0answers
53 views

How to refer to office365 user using Set-Mailbox in Powershell

I'm trying to change a user mailbox to a room mailbox in powershell. I know the basic command is: Set-Mailbox "John" -Type Room When I try to run this, I keep getting an error that says the object ...
1
vote
1answer
23 views

Test if PowerShell script being called with Invoke-Expression?

Is there a way to tell if a script is being called using Invoke-Expression rather than called directly? I want to do something different, e.g. pause for input, if the script is being called directly ...
0
votes
0answers
110 views

How do I troubleshoot “Failed to get staged packages for package” error when attempting to remove a provisioned app from an offline Windows 8.1 image?

When I attempt to remove provisioned apps from an offline Windows 8.1 image, most of the apps I want to remove cause no problem, but attempting to remove Microsoft.Office.OneNote causes an error. The ...
1
vote
1answer
30 views

Powershell to non-domain machine

I'm writing a small script that needs at one point to connect to a machine that is not a domain member. The machine the script is run from will always be a domain member. I've found that using the ...
2
votes
1answer
81 views

Set-NetFirewallRule alternative in Windows Server 2008

I am trying to Enable Powershell Remoting on a Windows Server 2008, but from what I understand, the default firewall exception is that PSRemoting is only allowed if the computer (both client and ...
0
votes
2answers
132 views

powershell change filename using first 10 characters and mask

This script was working fine for a while but I have found that users don't always comply with the correct naming conventions for it to be effective. I have been banging my head trying to modify it but ...
7
votes
3answers
1k views

Cannot set Powershell ExecutionPolicy for CurrentUser

Here is a sample of the commands I am running: PS C:\> Get-ExecutionPolicy -List Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined UserPolicy ...
2
votes
1answer
76 views

How to combine two foreach loops?

I've looked at how to combine multiple commands with psexec but none of the methods seems to work. Maybe it's because I'm running the script in PowerShell and not cmd.exe? I need to create user ...
11
votes
1answer
265 views

Windows Remote Management Over Untrusted Domains

I am currently trying to enable Windows Remote Management (specifically, Powershell Remoting) between 2 untrusted domains, and having no luck. A brief description of my setup: domain1 - my ...
0
votes
1answer
74 views

What permission is needed to use a service account to remote run powershell on a server?

I have a internal webapplication With a list of all the servers in our network. I want to be able to run a few PowerShell commands on the servers to gather usefull information. Invoke-WMIMethod and ...
1
vote
1answer
315 views

Scheduled task deployed via GP, that runs a powershell script on a network share by a AD service account

I've created a powershell script that runs Chocolatey updates as well as does some logging locally and on a network share. The script itself resides on a network share, and I'm hoping to be able to ...
1
vote
1answer
522 views

Retrieve SCCM collection membership via PowerShell

I'd like to find a PowerShell script that retrieve the SCCM collections for a given computer or user. I know this can be achieve via a SCCM query, but I'd like to do this using a PowerShell function. ...
1
vote
2answers
171 views

Retrieve internet proxy server address via PowerShell

I have to retrieve the proxy server address and port via PowerShell, so I can use the Invoke-Webrequest -uri http://some-site.com -Proxy command. The expected output should looks like ...
0
votes
1answer
258 views

Invoke-RestMethod cmdlet not found in Orchestrator 2012 R2 Run .Net Script Activity

I'm trying to use Invoke-RestMethod in a PowerShell script within an Orchestrator 2012 R2 runbook. When I run the runbook, it tells me: The term 'Invoke-RestMethod' is not recognized as the name ...
2
votes
1answer
245 views

Version v4.0.30319 of the .NET Framework is not installed and it is required to run version 3 of Windows PowerShell

I have a server which we are using for Batch processing. I can login to the server with svc_account and run powershell -f file.ps1 and it runs fine in either version 2 or 3 by the following - ...
0
votes
0answers
126 views

ERROR: OpenSSL::PKey::RSAError: data is too large for key size", when trying to upload cookbook 'learn_chef_iis'

I am receiving the following error message: "ERROR: OpenSSL::PKey::RSAError: data is too large for key size", when trying to upload cookbook 'learn_chef_iis'. I was following a CHEF tutorial and now I ...
1
vote
1answer
86 views

WMF 5.0 (April Preview) DSC Pull Server Installation fails

I am trying to install The DSC-Service Windows Feature on a Windows 2012 R2 machine with WMF 5.0 already installed. The installation fails with the following errors: Install-WindowsFeature ...
1
vote
1answer
72 views

Win Terminal Server/RDS - dynamic printer mapping after session reconnect

I am trying to figure out this Problem: When a user disconnects his/her RDS (on Windows Server 2012 R2) session in Office 1 and reconnects in Office 2, then still all the Printers relevant to Office 1 ...
1
vote
2answers
164 views

Polling FTPS/SFTP Server with Windows Server 2012

Is it possible to securely routinely poll an external FTPS (or SFTP) server and copy/move the files locally using standard Windows Server 2012 functionality? I imagine the use of scheduler to do the ...
3
votes
2answers
92 views

How can I retrieve a domain computer's details from AWS Directory Service?

I know using the AD module for powershell that we can retrieve domain computers details and export them as csv. My domain is in AWS Directory Service, and I have a computer under this domain. I tried ...
8
votes
3answers
330 views

PowerShell: Get-ADUser Properties with åäö

I'm trying to extract select sets of users with Get-ADUser. The users belong to companies whose names include non-ASCII characters, e.g. "Gåäördet". Unfortunately, we do have to use the company ...
1
vote
1answer
113 views

How to execute a powershell script from a remote application as a specific user

I have an application which can execute a powershell script on remote windows machine. I am trying to map a network drive using a powershell script. When the same script executed at the endpoint, ...
2
votes
1answer
302 views

powershell pipeline object to function

Here's the stub of what I'm trying to do: function Set-test { [CmdletBinding()] param( [Parameter(Mandatory=$True, ValueFromPipeline=$True)] [object[]]$inputObject ...
0
votes
1answer
55 views

PowerShell Write-Host not synchronous

I'm writing a PowerShell script to check some properties of a server. When I execute the following cmdlets in order, the output is not displayed in the order I expect. Write-Host "=== Operating ...
0
votes
1answer
19 views

Unable to perform enable-bitlocker and lock-bitlocker successively

I am trying to enable bitlocker on windows server 2012 R2 data volume using following command: Enable-BitLocker -MountPoint $volume -Password ($password | ConvertTo-SecureString -AsPlainText -Force) ...
1
vote
2answers
81 views

Exchange 2010 PowerShell: Value.ToMB() Method Fails Remotely but Works Locally

I am building a report of certain mailbox attributes from Exchange Server 2010 using PowerShell. The following code worked perfectly from my management workstation using a remote session. $Mailboxes ...
2
votes
1answer
111 views

Install Active Directory PowerShell module on Windows Server 2012

I need to install the AD PowerShell module on Windows Server 2012 but I can't afford for the server to restart during business hours. My question is can the AD module be installed from Add/Remove ...
4
votes
0answers
98 views

Get-Process not working against remote Windows 7 clients

I have been trying to run Microsoft's GetNetworkStatistics script against remote computers to enable us to track what processes are using bandwidth along with other tools. I am unable to run the ...
2
votes
1answer
77 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 ...
4
votes
1answer
146 views

With powershell get exactly the same application list as in Add/Remove programms

There are various methods to find installed applications on the system but to my knowledge none returns exactly the same list as control panel item Add Remove Programs. Some of the ways I tried are: ...
1
vote
1answer
58 views

Moving one website from one server to another using powershell

I've been reading about MS Deploy and writing a small script to export/import one website from one server to another server(IIS8 to IIS8). But I ran into sizing problems and some other errors and the ...
1
vote
1answer
50 views

Task Scheduled Powershell Script Not Shutting Down machine

I have a task running on a Hyper-V server setup as such: schtasks /CREATE /TN AutoShutdown /RU "SYSTEM" /TR "Powershell \"C:\AutoShutdown.ps1\"" /SC ONSTART It runs properly (as far as I can tell) ...
0
votes
1answer
95 views

Windows Network Interface Monitoring - Nagios/Powershell

Function netstat { Get-WmiObject Win32_PerfFormattedData_Tcpip_NetworkInterface | where{$_.Name -eq "vmxnet3 Ethernet Adapter"} | % { 'OK | Rx-B/s= {0:0}; Tx-B/s={1:0}' -f ($_.BytesReceivedPersec), ...
1
vote
0answers
37 views

Create websites from a csv file and folder permissions

I have a csv file that contains 10 different website configurations. I've created the script below to automate their creation. When I test the script, it runs succesfully, but I'm wondering if this ...
1
vote
0answers
50 views

Windows Forwarded Events date filter not working

I have a Windows Server 2008 R2 configured to receive forwarded events from a large amount of clients (Windows 7\8.1). It receives events in the event ID range of 8000-8006 from the WLAN-Autoconfig ...
3
votes
0answers
61 views

Best approach to deploy DLL file updates to Win7 clients

We are in a Windows 7 / Server 2008 R2 domain environment. We have a .NET application with lots of internal libraries for different UI and other features. We deploy it from a share where a directory ...
0
votes
1answer
134 views

powershell : System.Object[] instead of the actual path

The script below does not produce the path to the files in question, in my CSV file. Instead it is giving me System.Object[]. Please advise as to what I am doing wrong here. My goal is to clean up ...
2
votes
1answer
177 views

Install RSAT-Hyper-V-tools fails on Windows Server 2012 R2 Server Core

When I try to install Rsat-Hyper-v-tools with powershell command: add-windowsfeature rsat-hyper-v-tools -includeAllSubFeature It fails with error saying that: The source files could not be ...
3
votes
1answer
91 views

Scheduled PS Script Not Running

I'm trying to run the script from https://gallery.technet.microsoft.com/Password-Expiry-Email-177c3e27 I've corrected the variables for my environment and I'm able to run it from my workstation and ...
0
votes
0answers
53 views

powershell exchange 2013 get-mailbox command

The get-mailbox command does not work on powershell exchange 2013. Does anyone know a replacement command? I need to copy mail from a certain time period from one user to another. Thanks
0
votes
1answer
85 views

Write-S3Object : A parameter cannot be found that matches parameter name 'Credentials'

I’m trying to set up AWS deployment via the AWS Tools for Powershell on a new machine using write-s3object -credentials $aws_creds ..., and I’m running into the following error: Write-S3Object : A ...
5
votes
2answers
104 views

It seems like updates described in the KB3057134 make PowerShell to start slow

Starting this morning it takes 3-4 seconds to start even very simple PowerShell script on my machine. This command shows 3.2-3.4 seconds on my machine and only 0.4 second on co-worker's machine. ...
0
votes
2answers
326 views

“Maximum number of items that can be serialized or deserialized in an object graph” when executing GetMsolUser -All

I have an office 365 tenant on which I execute the following command Get-MsolUser -All on server A I get get-msoluser : The formatter threw an exception while trying to deserialize the message: ...
0
votes
1answer
81 views

Powershell script issue

I am having an error with the script below: $server_names = Get-Content "C:\ArchivedFolders.txt" Foreach ($server in $server_names){ Copy-Item "\\$server\C$\Mail\*" -Destination ...
2
votes
1answer
210 views

How can I input password to manage-bde -pw option via windows powershell

I am trying to encrypt Data volume (for example E:) with the following command: manage-bde -protectors -add E: -pw When I execute the above command, it will ask for the password, so I entered it. ...