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)

2
votes
2answers
53 views

Powershell - how to log all external cmd output?

I have a powershell script that works great from cmd line, but flakes out a lot when running from task scheduler. So I need to see all the console output from all the commands. The script does a lot ...
0
votes
1answer
44 views

WSUS API get update needed count

When looking at the WSUS 3.0 API, there is no way I can find if a given update is needed or not. The UpdateInstallationState enum has a NotApplicable value with the following description: "The update ...
0
votes
0answers
45 views

Windows Server 2012 EventViewer Powershell Script error

I am having a bit of a strange error, seems like it's permissions related, though I have done a fair amount of searching and none of the suggestions have worked. I have a powershell script, running ...
0
votes
3answers
45 views

Cannot add users to local group via powershell

Trying to import a large list of users for mac authentication. I can create the users but no matter what I try I cannot add them to a local group. I continually get "an invalid directory pathname was ...
0
votes
0answers
23 views

What powershell command I need to use to get the list of IPs assigned to cluster in a azure subnet

I have used below powershell command to get the used IP's in my azure virtual subnet. Get-AzureVM | Select-Object -Property Name, @{Name='StaticIP';Expression={(Get-AzureStaticVNetIP -VM $_ ...
0
votes
1answer
27 views

powercli math with vmware - datastore property division arithmetic

basically, I get all 0's returned in the percentage1 column. I need help with what I believe is syntax or incorrect use of Round. Get-Cluster "my_cluster" | Get-VMHost | Get-Datastore | Select ...
1
vote
0answers
56 views

Robocopy and IIS log date modified behavior

I am trying to create a mechanism (in my case Robocopy wrapped in PowerShell) that will back up IIS logs from all of our web servers into a central CIFS share. As you'd expect, I've had issues with ...
0
votes
0answers
31 views

IIS Clear-WebConfiguration cmdlet needs to be executed twice for inherited URL Authorization rules

I am trying to write a DSC resource to manage IIS URL Authorization rules, however when attempting to remove an inherited rule (via Clear-WebConfiguration) instead of removing the rule it is creating ...
0
votes
0answers
30 views

SSH connection Timeout using CHEF

When I run the following code in PowerShell: chef-repo> knife bootstrap windows winrm 172.25.174.27 -x Admin -P 'Microsoft@1234567' -N 'target1' I get an error: ERROR: ...
0
votes
1answer
50 views

Windows Task Scheduler don't show execution errors

I'm trying to make a powerscript that will run from time to time through the windows task scheduler. My problem is that the task scheduler do not display the task as failed, even though my script do ...
0
votes
2answers
56 views

What can I use to do a detailed comparison of local and network share data?

I've got an IT problem I could use some assistance with. I work at a large organization with many users (1000+). We're currently on a mixed Server 2012 R2/2008/Windows 7 environment. The situation is ...
3
votes
1answer
37 views

Is windows docker images the same with windows container images?

I was following this article to learn about Windows Container in Windows Server TP4. Since the article came with both 'Powershell way' and 'docker way', then I thought that both ways are ...
0
votes
0answers
35 views

new-pssession previously working code now gets Access is denied

I hope someone can shed some light on this one, I've been using the below code below to create a new PSSession for months and has been working perfectly! Until today where it has suddenly started ...
0
votes
2answers
31 views

Why do Exchange Display Name changes not appear in PowerShell?

I used the Exchange 2013 ECP to update all of my inactive mailboxes by adding "zzz" before their Display Name. (Only the Display Name field was affected). In PowerShell, I want to list all mailboxes ...
0
votes
1answer
78 views

Send Email Notification if service is Stopped

Working on this script to get email notification when 1 or more services are not running. something is wrong here, it sends: System.ServiceProcess.ServiceController is running $service=Get-Service ...
0
votes
1answer
246 views

Windows 10 Kiosk Modus with Custom shell

I would like to setup a Kiosk Modus where user is logged on and Browser starts automatically. Windows Custom Shell $COMPUTER = "localhost" $NAMESPACE = "root\standardcimv2\embedded" # Create a ...
0
votes
0answers
20 views

How can I get just 5 min intervals from an ESXi host?

I'm connected to an esxi host with the powershell snapin (not a vcenter server). ESXi servers are supposed to aggregate realtime data (20 sec intervals) into 5 min intervals right? Can I get just ...
0
votes
2answers
58 views

Powershell equivalent of Ctrl+R?

In bash I can do Ctrl+R and start typing a command to have it search my history. How do I do that in powershell? Is there a way to bind a key to something like function GH($str) {get-history | ...
2
votes
1answer
42 views

Delete only files leaving empty sub-folders using powershell

C:\Temp\ifc has about 297 folders inside it with roughly 4.1 million files spread amongst them. Using a script I found elsewhere on this site, I wrote the following to delete all 'files' which are ...
0
votes
0answers
26 views

how to format a list of IIS sites

I've been have a lot of trouble creating a script to provide me with csv file of IIS sites. My goal is to run this script once a day on all our webservers and update an excel spreadsheet with all of ...
-1
votes
2answers
40 views

Merge 2 PowerShell commands to 1

I have a powershell commands to list all AD computers last logon date Get-ADComputer -Filter {enabled -eq $true} -properties * | select Name, LastLogonDate | Sort LastLogondate -Descending | ...
0
votes
1answer
28 views

Invoke-Command -AsJob starts “running” jobs forever when too many are started

I guess there is a limit set somehwere or a limit that manifests itself when a certain (somewhat variable) number of concurrent jobs is reached. What I am trying to do is run a small script on many ...
2
votes
1answer
79 views

Calling powershell.exe is extremely slow

I have a Windows 2008 R2 server with Powershell V4.0 I got a very simple script test.ps1 with this content : Write-host "Hello world!" I call this script from a powershell prompt like this : ...
-2
votes
1answer
40 views

Using the FileSystem provider [closed]

I need to use the FileSystem provider and using an appropriate cmdlet, create a zero-lenght file name C:\Zero.txt. I know I need to use New-Item within it. Any ideas?
3
votes
2answers
70 views

Health-Check on .NET 4.5 Installation

On a Windows Server 2012 R2 Core Server box, I get these results: PS C:\Users\vagrant> Get-WindowsFeature | Where-Object {$_.DisplayName -like "*.NET*"} Display Name ...
0
votes
1answer
66 views

How can I move email messages from Exchange Online to Gmail?

We have an Exchange Online mailbox that received hundreds of emails that were supposed to be forwarded via an inbox rule to an @gmail.com address. I've setup an inbox rule to handle any new messages ...
1
vote
1answer
80 views

Installing Web Deploy with Desired State Configuration (DSC) silently fails

Absolutely brand new to DSC, so I am really stumbling through things right now. I have a basic configuration that ensures IIS, .NET 4.5, and MSMQ are installed. I am working toward configuring a new ...
0
votes
1answer
42 views

Using an alias in a script to display computer name

I am attempting the following code, but I can't get the computer name to display once I open a powershell session. Can anyone help? New-Alias myhome get-myhome function get-myhome { $computername = ...
1
vote
1answer
40 views

Delay when creating mailboxes in exchange

I've been creating mailboxes for some of our existing users who don't have their own mailbox so I've written a little script to make things easier for myself. Relevant extract below. $exchange = ...
0
votes
1answer
31 views

Comparing/Matching ACLs

Rather it be through PowerShell or another tool here is what I'm trying to accomplish and where it stems from. We have Junction points on one volume and the Target folders on another volume. ...
-1
votes
1answer
25 views

Displaying methods of the wshNetwork object [closed]

I need to create a variable to represent the wshNetwork object. Using this variable I need to display all the methods that this object supports, and only display these methods? Any suggestions? ...
2
votes
2answers
65 views

Powershell: Save CSV result to folder

This should be absuredly easy but I keep running into a brick wall. I am running a Powershell script which performs an audit of my tasks and saves the result to a CSV. I keep getting a permissions ...
1
vote
2answers
39 views

Listing the parameters of Get-Eventlog cmdlet

I need to use the Get-Eventlog cmdlet to display just the log name and the retention period. I've used Get-Eventlog -list | format-table log, retain but it only displays the log and the "retain" ...
0
votes
1answer
48 views

Is there any way to add an HTTP Header to every IE request on a computer?

I would like to add a custom HTTP Header to every Internet Explorer request on a computer (or every browser request). I don't know if this is possible whatsoever, if you have heard of anyway to ...
1
vote
0answers
39 views

How do I extend the timeout value for long-duration playbooks ran against Windows servers?

I have Ansible playbooks that can transfer files to Windows servers. I have Ansible playbooks that can run small PowerShell scripts. But I cannot get an Ansible playbook to run a long-running ...
4
votes
1answer
65 views

PowerShell pipe into find.exe command

Just curious, why does this happen? If I run: netstat -an | find "443" into a command prompt, "443" connections are displayed ok. If I run the same command in a PowerShell console or ISE, I get ...
0
votes
1answer
51 views

Importing ExtensionAttribute via CSV with Powershell

I am trying to populate the attribute ExtensionAttribute7 with a CSV file. The CSV file has two columns: samAccountName and ExtensionAttribute7 I import the Active Directory module and have been ...
0
votes
1answer
56 views

Having trouble passing a PowerShell variable to a command line argument

I am working on a script that takes a powershell variable and uses it in a script block running the net command. Here is the code: $User = "domain\user" Invoke-Command -ComputerName $ComputerName ...
0
votes
2answers
113 views

Powershell connection to exchange 2013 powershell works randomly?

I am currently working on a script that connects to our mailserver and purges a specific folder in a mailbox, I got everything working without a problem except the connecting to the server. When I ...
0
votes
0answers
63 views

How to run PowerShell ActiveDirectory command Get-ADObject over SSL

To query AD DS or AD LDS, I can successfully run the following Powershell commands: get-adrootdse -server 'localhost:389' get-adobject -server 'localhost:389' -searchbase 'dc=test,dc=com' ...
0
votes
1answer
57 views

Powershell module 'servermanager' not found on Windows 10

I am running windows 10 on a virtual machine and I would like to list the windows feature available by running the following commands on powershell: Import-Module ServerManager Get-WindowsFeature ...
3
votes
1answer
34 views

Find where powershell onload settings are

On a corporate machine, whenever one attempts to open Powershell, Powershell sends many requests to domain controllers. This would be find if the machine was on the network, but when it's not, then it ...
1
vote
1answer
50 views

clamav: cannot scan from a file list on Windows?

salt win8 grains.item osfullname win8: ---------- osfullname: Microsoft Windows 8.1 Enterprise Evaluation salt win8 cmd.run shell='powershell' '& "C:\\Program ...
2
votes
1answer
35 views

Exchange 2010 address location

Can someone tell me where Exchange 2010 stores e-mail address information? Has it moved from the proxyAddresses attribute in ActiveDirectory? Does "(Get-Mailbox).EmailAddresses" give the same info ...
0
votes
1answer
34 views

how to fetch details from multiple domain

I am trying to create AD report in html via powershell but unable to fetch details from multiple domain, below is my code, # HTML Style $a = "<style>" $a = $a + ...
1
vote
1answer
46 views

Powershell script to create folder based on username and then move profile data

I am having to create a solution to backup user profiles on a domain (not VDI's) I have the following script that I got to copy the favorites folder, the issue I am having is that I need the script to ...
-1
votes
1answer
43 views

How to get member of details recently created ad users via powershell in html

I am trying to fetch ad user created details, but unable to get member of details, below is my script $date = (Get-Date).AddDays(-7) Get-ADUser -Filter * -Properties * |where { $_.whenCreated -ge ...
0
votes
1answer
43 views

Exchange 2007 Management Shell (EMS) not working

Windows Server Standard FE (2008) - Service Pack 2 (SBS) Exchange 2007 (08.01.0436.000) - Version 8.1 (Build 2406) (Tried to find the Service Pack version, but the only way that I can see to do this ...
4
votes
1answer
52 views

Change active directory display name format in PowerShell?

Is there a way, using PowerShell, to change the AD format of the usernames to Lastname, Firstname? I know how to do it manually like the answer given here. I am trying to see if I can add this to a ...
3
votes
1answer
83 views

PowerShell: export GPO to a text file

I'm new to Windows Server, and I'm curious: is there any way to dump group security settings to a text file, using PowerShell or batch files? Thank you!