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)

5
votes
3answers
10k views

What version of Windows Management Framework is installed?

How do you check to see what version of Windows Management Framework (WMF) is installed? It seems like it should be a simple thing to find out, but I cannot. Even Googling a bunch of different ...
0
votes
1answer
77 views

Server 2012 R2 - Features on Demand issue with powershell - Pulling roles/features from remote share

This is for learning/lab purposes. -Two 2012 R2 servers. Server 1 is Standard GUI and server 2 is Server core. -Server 1 is updated, Server 2 is not updated at all with any windows updates -Workgroup ...
2
votes
2answers
64 views

Extracting GPO through Commandline/Powershell

Im writing a script through powershell and i would like to extract the whole local policies. I understand that secedit will exttract the Account policies only, and the only way to do this is via going ...
0
votes
2answers
45 views

Unable to remove publicfolder replicas on exchange 2007

I try to decommissioning my Exchange 2007 server after migration to Exchange 2013, to migrate to 2016 in the future. I removed all mailbox databases, but not the publicfolder database, i got an error ...
4
votes
5answers
10k views

PowerShell Import DnsShell Module

So here's the list of available modules in this directory. As you can see DnsShell is there. PS C:\windows\system32> Get-Module -ListAvailable Directory: C:\windows\system32\WindowsPowerShell\...
0
votes
1answer
117 views

Creating active directory users with powershell - the mapped home folder is not mapping until edited

I'm creating active directory users in bulk from a .csv using powershell. Each user has their profile home folder path mapped to a drive letter. The script runs through fine, users are created and ...
0
votes
0answers
15 views

RSH from Linux to WIN7 and access COM port

I have a script(run on a Linux machine) , and does the following rsh to a Windoes machine (rsh XX.XX.XX.XX CMD) cd to a directory (cd YY) run a script (say ZZ.pl --someargument) it runs fine when ...
13
votes
2answers
36k views

How to ignore an error in Powershell and let it continue?

I am trying to see if a process is running on multiple servers and then format it into a table. get-process -ComputerName server1,server2,server3 -name explorer | Select-Object processname,...
0
votes
1answer
43 views

Importing Bulk Users from .csv file leads to user logon name and domain being blank

I have the following issue when adding bulk users through a .csv file: the user logon name and the domain are blank, however the user logon name (Pre windows 2003) is showing ok. Because of this, I am ...
0
votes
0answers
15 views

IIS - overrideModeDefault enforced in PowerShell, not IIS UI

I am trying to modify an IIS Web Application that is installed, and change the Authentication Methods. The Default Web Site is set to alloy Anonymous, and disable everything else. When I use the ...
0
votes
2answers
2k views

Can Set-QADUser set all properties?

I'm using the Quest commandlets for a very simple and straightforward update but it's not working. No errors, it just fails to change the value: Set-QADUser ttest -ObjectAttributes @{office="ABQ"} ...
2
votes
2answers
2k views

powershell v2 remoting - How do you enable unecrypted traffic

I'm writing a powershell v2 script that I'd like to run against a remote server. When I run it, I get the error : Connecting to remote server failed with the following error message : The ...
0
votes
1answer
31 views

Azure Resource Manager Virtual Machines LUN limit of 4?

Add-AzureVMDataDisk (for classic VMs) allowed me to specify a LUN from 0-15. Now Add-AzureRmVMDataDisk (for ARM VMs) has a limit of 0-3. Why the change? How can I add more that 4 disks to my ARM VM?
10
votes
2answers
5k views

How do you manually set Powershell's OneGet repository source to Chocolatey?

The OneGet Powershell module should ship with the default repository being Chocolatey. This is shown in the documentation found here. However when I run Get-PackageSource it returns PSGallery and ...
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 { ...
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 ...
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 ...
7
votes
1answer
8k views

Installation of Windows Management Framework 4.0 (Powershell 4.0) on Server 2012 failed

I've been trying to test PowerShell Desired State configuration on a Windows Server 2012 instance on Amazon EC2. I downloaded the Windows Management Framework 4.0 from the MS download center: Windows ...
2
votes
2answers
8k 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. ...
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 ...
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
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 ...
7
votes
1answer
3k views

How to get SCCM to recognize return codes from Powershell script completion?

I'm using an SCCM 2012 application deployment to install software. The specific install type is scripted installer as SCCM kept failing for exe validation errors. The script is powershell and ...
8
votes
2answers
80k views

List All Groups and Their Members with PowerShell on Win2008r2

I am new to powershell, but I've been reading manuals and practiced a little bit. My objective is to List all users in all Security Groups under specified path. I have found the way to do it: get-...
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 ...
1
vote
5answers
34k views

Office 365 Powershell - Export user, license type, and company field to csv file

I need to be able to export user name or email address (doesn't matter which), company (from the company field under the organization tab in a user account of the exchange admin console), and license ...
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 ...
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-...
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. ...
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 ...
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
2answers
625 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....
14
votes
12answers
113k views

Windows command prompt: how to get the count of all files in current directory?

What command would you use in cmd.exe to find the number of files in the current directory? Is there a powershell option here? Update: I was hoping to avoid dir, as I know there are 10,000+ files in ...
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 ...
1
vote
1answer
254 views

Error in getting powershell remote session through ssh-enabled PowerShell

I am trying to login to windows 2008 server "C" from my machine "A". There is machine in between "B" serving as jumpbox running windows server 2008 and running "SSH-Enabled PowerShell Access for ...
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,@{...
0
votes
1answer
2k views

How to set Windows Services permissions from Powershell?

I need to grant a specific account SERVICE_START permissions for a given Windows service. There seems to be some methods for doing so here, but would prefer a method that's native to PowerShell and ...
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
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
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 ...
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 ...
1
vote
1answer
706 views

Powershell execute Queries using SQLPLUS

I have a RHEL server with Oracle 10G installed. I need to write a powershell script to query my database and get the output. I have imported Posh-SSH module and am able to connect to my RHEL server ...