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)

1
vote
2answers
51 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 ...
1
vote
1answer
18 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 ...
4
votes
2answers
1k views

Why am I getting unauthorized errors with Powershell get-winevent?

I'm a domain admin equivalent, I've tried running in an elevated console (right-click> run as administrator), and I'm consistently getting errors when executing get-winevent -logname application | ...
6
votes
1answer
94 views

Powershell's equivalent to Bash's process substitution

Bash has <(..) for process substitution. What is Powershell's equivalent? I know there is $(...), but it returns a string, while <(..) returns a file the outer command can read from, which is ...
-3
votes
0answers
9 views

convert Dyamic DNS record to Static DNS record using CSV

I have a problem here that I have a list (.csv) of resource record in DNS (currently they're in dynamic) and i would like to convert them to static record. Do you have a powershell script for this ...
1
vote
1answer
7 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
votes
0answers
11 views

Monitoring changes to a directory and getting an e-mail for the changed/newly created files using a powershell script

I am new to Powershell scripting and trying to use a Powershell script to monitor changes in a directory and be informed of any new file creations or changes daily. Param ( [string]$Path = ...
0
votes
0answers
17 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
0answers
56 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 - ...
1
vote
1answer
20 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 ...
0
votes
1answer
25 views

PowerShell script to click a javascript hyperlink

Powershell script to open webpage and click a specific link I am trying to write a script that opens up a specific webpage and clicks a specific link. I cannot edit the HTML as it is embedded on a ...
2
votes
2answers
27 views

AD Powershell Module to retrieve from AWS Directory Service

I know using AD module for powershell we can retrieve domain computers details and export it as csv. But I have my domain in AWS directory service and I have a computer under this domain. I tried ...
0
votes
0answers
11 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
2answers
44 views

PowerShell - How to format the output of two distinct commands in one table?

Foreach($a In Get-GPO -All) { Foreach($b In $a | Get-GPPermissions -TargetName "Domain Admins" -TargetType Group) { $a.DisplayName; $b.Trustee.Name; $b.Permission } } I use the command to output all ...
1
vote
1answer
18 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
35 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 ...
1
vote
1answer
26 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 ...
0
votes
2answers
1k views

KQL Query to specify date range for Mailbox search?

I'm trying to verify some phone numbers using our exchange server with the following query to send the results to my inbox: Get-Mailbox | Search-Mailbox -SearchQuery “Body: '*XXX-XXX-XXXX*' OR ...
9
votes
4answers
11k views

PowerShell remove force

Trying to delete a directory recursively with rm -Force -Recurse somedirectory, I get several "The directory is not empty" errors. If I retry the same command, it succeeds. Example: PS I:\Documents ...
11
votes
1answer
5k views

How do I run my PowerShell scripts in parallel without using Jobs?

If I have a script that I need to run against multiple computers, or with multiple different arguments, how can I execute it in parallel, without having to incur the overhead of spawning a new PSJob ...
0
votes
1answer
59 views

How to find out all users and their details using a single line command on windows server 2012 active directory? [closed]

I would like to know if there is a single line command in dsquery or LDIFDE or any other command to fetch the details of all the users in all the domains in my Active directory.
0
votes
1answer
112 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: ...
8
votes
3answers
142 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 ...
3
votes
2answers
2k views

How can a set a Security Group's email address using PowerShell?

I need to create many groups with email addresses. I would prefer to use Security Groups to reduce the number of groups we have to maintain, otherwise we'd have an identical Distribution Group for ...
11
votes
4answers
2k views

Windows Powershell Vim Keybindings

Is there a way to get vim keybindings in powershell as you would in bash or zsh with a command like set -o vi
1
vote
1answer
972 views

How can I get the number of users actively using Lync?

How can I report on the number of users actively using Lync in my organisation? I want to be able to find out what the uptake is. Thought about going through our mail server, but the saved ...
3
votes
1answer
1k views

Exchange's New-MailboxExportRequest behaves strangely with DateTime parameters to ContentFilter

I am attempting to extract a certain date-range of emails from a mailbox into a PST, but using a DateTime parameter for ContentFilter doesn't seem to work as expected. This should export everything ...
2
votes
1answer
42 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 ...
1
vote
1answer
41 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, ...
0
votes
1answer
11 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) ...
0
votes
1answer
29 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 ...
1
vote
2answers
1k views

Importing NTFSSecurity module from UNC path fails

I've created a central repository for Powershell modules, but I'm having trouble loading one in particular. The NTFSSecurity module is failing to import with the following message. PS Z:\> ...
4
votes
3answers
6k views

Powershell: lastLogonTimestamp blank for some users

I am developing a script to report on users who have not logged in to the domain for 6 months. I'm using lastLogonTimestamp as within 14 days is precise enough for my purposes, and I don't want to ...
2
votes
1answer
97 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 ...
1
vote
2answers
33 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 ...
0
votes
1answer
85 views

Is there any outlook.exe /resetfolders equivalent that can be executed against all Exchange mailboxes?

Outlook can "Restore missing folders for the default delivery location" if ran with a switch "outlook.exe /resetfolders". This is good for just one or two mailboxes. What can I do if I need to do this ...
2
votes
1answer
50 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 ...
3
votes
0answers
36 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 ...
4
votes
1answer
61 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
33 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
33 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
22 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 ...
0
votes
1answer
2k views

How to save event logs “Network Policy and Access Services” on NPS server

We have a Windows Server 2008 R2 Enterprise server with NPS role installed in it. (We dont use NAP). Is there any way, we can save all the event logs in------ Event Viewer -> Custom Views -> ...
5
votes
4answers
8k views

Enabling Powershell Remoting, Access is denied?

I am trying to enable Powershell remoting on a Windows 2008 R2 Server, running in workgroup mode. I ran the command Enable-PSRemoting in the PowerShell Console. PS C:\Windows\system32> ...
1
vote
0answers
21 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 ...
5
votes
1answer
1k views

Exchange 2010 Auto-mapping mailboxes feature doesn't work when groups grant permissions

I have a shared mailbox that I need to deploy to one of our departments in an Exchange 2010 SP2 environment with Outlook 2010 clients. I'm trying to rely on the auto-mapping feature introduced by ...
5
votes
1answer
2k views

Batch script is not getting executed when called by Start-Process Cmdlet

I have a strange issue on a Windows Server 2012 R2 here that just does not make any sense to me at all. I've got a PowerShell script that basically has the following structure: Function ...
1
vote
2answers
912 views

Powershell - winrm using ip address instead of computer name

Is it possible to set up winrm using IP address instead of the computer name. The computer in question is only I have only been able to set winrm up for a computer in the same domain like this: ...
0
votes
1answer
1k views

How to export Exchange public folder permissions and import them to a different system?

I'm involved in a migration from Exchange 2010 to Office 365 (Exchange 2013); all user mailboxes have already been successfully migrated, but due to some glitch or bug that even Microsoft's support ...
0
votes
1answer
41 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 ...