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
45 views

Azure Resource Manager and Powershell DSC - changes not being applied

I have an ARM template with a Powershell DSC extension section running the following DSC: Configuration Name { Node MachineName { #IIS Role WindowsFeature IIS { ...
3
votes
0answers
76 views

Compressing folders with long paths

I am now the proud owner of my company's off-boarding script (Yay!). I have been going through the code and testing, and I noticed that on some users' homefolders I am hitting PowerShell's 260 ...
1
vote
2answers
209 views

Why is my logon script not mapping any drives?

I've written a logon script in PowerShell. The Script is embedded in GPO and runs when a user is logging into the domain. My Problem is, that the drives I deploy in the Script don't get deployed. I'm ...
0
votes
1answer
58 views

Get-AzureStorageAccount is not returning premium accounts (only standard accounts)

Does anyone know why the Azure PowerShell cmdlet Get-AzureStorageAccount only returns standard storage accounts? I have two standard and two premium storage accounts in my one Azure subscription, and ...
1
vote
1answer
62 views

How to find out IE's Proxy settings for all users on a server (i.e. Windows 2008R2)?

I am trying to pull this information with the following below powershell script but it is only fetching the information for my profile and not all the users that have logged in to the server. Am I ...
3
votes
1answer
97 views

How can I force a client to update its IP address in SCCM?

I am testing some networking issues with a machine that i need to move through the organization, this make the machine to change its ip. SCCM need to update this ip (highlighted in the picture) in ...
1
vote
1answer
147 views

How to hide command window at while running powershell script through the task scheduler?

I have powershell script with GUI form which show message by condition. This script is runnig through the task scheduler every 15 minutes. Every running shows me concole window, then GUI form with ...
5
votes
0answers
69 views

Using defaultAuthenticationType with PowerShell Web Access

PowerShell web access lets you choose the authentication type. By default, it uses a value of Default, which ends up being Negotiate. I have set up CredSSP to allow logging into the PSWA server itself ...
1
vote
0answers
38 views

Full control over powershell colors

I wanted to customize my shell by enumerating all the possible options and giving them alternate values. I have searched high and low, but there is practically no good guide on doing it, the closest ...
2
votes
0answers
44 views

Problems with a script uninstall (SCCM 2012) and its causing the detection method to fail

We use the Powershell Application Deployment Toolkit for deploying applications in SCCM. I'm currently working on uninstalling Sophos VPN from machines in a certain collection in our environment. ...
1
vote
1answer
47 views

PSEXEC - The system cannot find the path specified

I am trying to initiate a Endpoint protection scan on a network share. I found that I need to utilize PSEXEC to complete this but it is having problems connecting to the share. I mapped the drive ...
0
votes
3answers
59 views

Azure Powershell - Staying Logged in

I need to be able to store many azure subscriptions and load them when needed. I have saved the profile with... Save-AzureRmProfile -Path 'C:\Temp\profile.json' Then i can load it with Select-...
0
votes
1answer
65 views

AD automation setting home drive and logon script

I was able to set home drive and and logon script for each user but the problem is it doesn't creates home folder something looks wrong with get-aduser -filter * foreach {New-Item -ItemType Directory ...
0
votes
2answers
623 views

Azure VM change OS Disk

I've create an Azure VM in RM and have deleted the VM and Components expect the OSDisk in an Premium Storage Account (Blobs). Now i wouldd like to create an new VM and attach the OS Disk to the new VM....
2
votes
2answers
70 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
79 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
91 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
59 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
24 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
39 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 Name,@{...
1
vote
0answers
59 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
60 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
59 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: Net::SSH::...
0
votes
1answer
172 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
58 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
2answers
46 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
58 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
38 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
90 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
559 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
21 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
77 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
50 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
32 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 | Export-...
0
votes
1answer
37 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
105 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
42 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
82 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
107 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
209 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
60 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
51 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 = New-...
0
votes
1answer
32 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
27 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
98 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
53 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
55 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
49 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
76 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 ...