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)

9
votes
0answers
1k views

Import Powershell AD Module during MDT Task Sequence

I have written this short powershell script to rename a computer as part of an MDT task sequence: Import-Module ActiveDirectory $AdminUsername = 'domain.com\administrator' $AdminPassword = ...
8
votes
0answers
505 views

How to persist credentials in a remote Powershell session?

I have an Azure File Share and would like to use this from my Azure VMs - after persisting the credentials on the VMs with cmdkey and mounting with net use. This was tested by running these commands ...
4
votes
0answers
63 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 ...
4
votes
0answers
221 views

Using get-wsuscomputer with -ComputerUpdateStatus

I have WSUS installed on a Server 2012R2 box. I am trying to use the Get-WsusComputer powershell command to get a list of computers with pending or failed updates. The documentation for the command ...
4
votes
0answers
291 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
0answers
119 views

Besides looking dumping $PSVersionTable and dumping the variable and env “PS-Drives”, what else can I do to compare PowerShell environments?

Besides looking dumping $PSVersionTable and dumping the variable and env "PS-Drives", what can I do to compare PowerShell environments? Here's the problem: I have very similar machines running ...
3
votes
0answers
70 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 ...
3
votes
0answers
138 views

Powershell DSC File copy - Workgroup machines

I've got a machine that I need to copy files to from a network share (on domain) for a deployment from a machine that's off domain. Currently I have the following code; Configuration deployWebsite ...
3
votes
0answers
534 views

Adding multiple users from a group to an Active Directory group using Powershell

I have a powershell script that is supposed to go through a specific ou and store the groups into a variable $groups. Here is the code I use in the script: $Groups = Get-ADGroup -Properties * ...
3
votes
0answers
12k views

List ALL Printers using Powershell

I'm having issues listing all the printers on a computer using Powershell. We have a batch script that will add/remove/list "per computer" printers using PrintUI. I can use PrintUI to list the ...
2
votes
0answers
41 views

Changing Windows Server 2012R2 maintenance time with PS

I'm struggling with this for the past few weeks and I hope someone has THE answer that works. At my work we use VMWare and I've build a automated deployment of Windows server 2012R2 with Powershell, ...
2
votes
0answers
45 views

Why does Get-Winevent in parallel workflow wants to use PSRemoting?

I'm building a wrapper script for Get-Winevent to search multiple computers' event logs in parallel, using multiple search criteria. I'm contructing a XML filter for Get-Winevent, then call this ...
2
votes
0answers
39 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
0answers
92 views

Get-WmiObject Win32_PerfFormattedData_Tcpip_NetworkInterface results in 'Invalid Class' error

On of my Nagios plugins to monitor the network load gives me problems on one Windows 2008 R2 server (out of 600). You can download the plugin here: ...
2
votes
0answers
31 views

Retention for Attachments - - - Microsoft Exchange 2010

Currently I am working with getting rid of voicemail to email files to save space in our archiving solution. Currently I have a search-mailbox script written to take care of deleting the voicemail ...
2
votes
0answers
212 views

Viewing Storage Space allocation for physical disk

I have a server that had four disks (2x 4TB and 2x 3TB drives) in a Server 2012 R2 Storage Pool. There are two virtual disks in the pool - a parity disk and a mirrored disk. The idea was to add two ...
2
votes
0answers
56 views

Deploying Server 2012 with DNS role using WDS and answer file

I want to deploy an image using WDS on Server 2012. I will be using an answer file for unattended installation with little touch as possible. My answer file works great but I can't get the auto-logon ...
2
votes
0answers
1k views

How to retrieve a MDT task sequence variable and use it properly inside Powershell

I'm trying to retrieve a MDT task sequence variable inside a Powershell script, then use that variable in a Powershell function. My problem lies in that the variable I want to retrieve contains a ...
2
votes
0answers
303 views

Can not install Office 2010 via winrm

I am trying to install Microsoft Office 2010, I have created a MSP and config.xml file so I can do this from Powershell, using the following command: Start-Process "C:\temp\Office2010\x86\setup.exe" ...
2
votes
0answers
96 views

Set CMTrace Font

Might be a bit of a long shot but I was wondering if anyone knew of, or could speculate on, a way to change the default font of CMTrace. It seems to use some Sans-Serif font. I'd like to change it to ...
2
votes
0answers
133 views

Powershell command providing incomplete list

This PS command is only returning 10 out of 12 groups that the user is member of. Anyone know why that will be? Get-ADUser -Identity username -Properties memberOf | Select -ExpandProperty memberOf ...
2
votes
0answers
343 views

Powershell Install-WindowsFeature Application-Server (and subfeatures) and assign certificate

I want to use a Powershell script to install Application Server on a windows 2012 server. When using the wizard, it prompts for you to select a certificate (for WS-Atomic Transactions) from the local ...
2
votes
0answers
222 views

how do i combine multiple powershell scripts in a guided install (for example with wix) but without the trail (ARP etc.)

I am working on a project where we need to repeat certain steps with powershell to deploy stuff. i would like to create a process/install guidance (steps supported with UI) with WIX but after the msi ...
2
votes
0answers
218 views

Query performance counters from powershell

I am trying this script to query performance counters in different localized windows server versions. http://www.powershellmagazine.com/2013/07/19/querying-performance-counters-from-powershell/ ...
2
votes
0answers
4k views

Exchange (2013) Powershell Connection Error

I am using Windows 2008 R2 with Exchange 2013 I am trying to connect to my exchange server with the following command but receive an error each time: $session = New-PSSession -ConfigurationName ...
2
votes
0answers
1k views

Powershell and sharepoint and updatelistitems() exception

I've got an issue where I keep getting "Exception calling "UpdateListItems" with "2" argument(s): "Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown." whenever I ...
1
vote
0answers
36 views

How to disable “do not allow drive redirection” local policy not using GUI?

I need to do it preferably using powershell/batch but after searching there is only some instructions for creatig adm/admx files. Is there an easier way to do this? I've also found a registry key ...
1
vote
0answers
31 views

Get-WmiCounter Win32_PerfFormattedData_NETFramework_NETCLRMemory Incomplete in non admin context

So I have created a script to gather counters using Get-CimInstance (which supercedes Get-WMIObject) and run it as a services via srvany.exe. I get an issue where for the .Net CLR classes, some ...
1
vote
0answers
33 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 ...
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 ...
1
vote
0answers
44 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 ...
1
vote
0answers
54 views

Powershell command works in local PS prompt, but not in a remote PS prompt

I am just beginning to use PS Remoting to administer servers but have run into a snag. When I am at the local server command line, I can run a command like Get-DfsReplicationGroup and the prompt ...
1
vote
0answers
62 views

How to do I create linux VM with ssh public on azure automation

Right now, I am creating Linux VM without public key on azure automation. My aim is to create linux VM with ssh public key on azure automation. How to get ssh public key from "accets" on azure ...
1
vote
0answers
186 views

PowerShell: Populating TreeView with Directory Hierarchy

So I'm attempting to write a PowerShell script with a GUI input; idea being that the end users see a nested TreeView of the file system. They tick a some folders, hit a button, ...magic happens. I ...
1
vote
0answers
31 views

Powershell Script to Automate Mailbox to PST

I have one script which is working though but I am not a advanced programmer. Please somebody modify my script as I wanted to ? 1) Mailboxes should be exported from specific server "ServerX". Right ...
1
vote
0answers
67 views

Windows Management Framework 4.0 via GPO

I'm planning to set up a PowerShell-Masterserver. In order to do that I want to make sure that every Computer and Server running Windows 7 or Windows Server 2008 R2 has PowerShell 4.0 installed. To ...
1
vote
0answers
31 views

Remote Desktop Farm Deployment ports

I'm in an environment where the firewall is very strict (as in every port is closed unless requested to be opened). When deploying my 2008 R2 Remote Desktop Farm through PowerShell I'm getting to ...
1
vote
0answers
26 views

Hyper-V 2012 R2 x64 UpdateID

I'm trying to write a powershell script in order to manage my updates for multiple Hyper-V 2012 R2 machines. To problem i stumbled upon is that i am unable to find the updateId for it so i can manage ...
1
vote
0answers
35 views

PowerShell - Simple local security CmdLets

As of 2015, are there any simple CmdLets, either in an MS module or a community project, for managing roles and permissions and ACLs, as easy to use as the old DOS commands, e.g. net localgroup? I ...
1
vote
0answers
41 views

Configure cloud-config using Azure Powershell 1.0

I have spent some significant time getting an Azure PS script starting up a few CoreOS instances. I have everything working except I have no clue how to get the cloud-config added. Using the CLI, ...
1
vote
0answers
44 views

PowerCLI - Network nested ESXi

Is there a way to configure the management interface of a nested ESXi Guest over PowerCLI? I'm looking to automate the configuration of a nested ESXi VM for testing customer configurations / ...
1
vote
0answers
78 views

Running apps on remote machine using current user credentials

I'm using enter-pssession to connect to a remote machine via Powershell. I then try to run an application via this connection on the remote machine. However, when I do this, it believes the user is ...
1
vote
0answers
50 views

Issues with Powershell Remoting

I'm configuring a new network and i need to enable Powershell Remoting. I'm in an Active Directory Domain and all my Clients are connected to the Domain. I'm able to run remote commands (Get-Process ...
1
vote
0answers
274 views

enter-pssession : Connecting to remote server failed with the following error message : The user name or password is incorrect

I am unable to connect to domain controller via below script. This script is working for another domain controller so it mean script is correct. While I am connecting i am getting an error: ...
1
vote
0answers
232 views

Windows 2012 Post-sysprep Powershell script not running

I have 2 templates 1 x Windows 2008 R2 1 x Windows 2012 R2 I have sysprep'ed both templates, Generalize / shutdown, etc, etc On both templates have I the following post-sysprep script that should ...
1
vote
0answers
343 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
0answers
76 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
153 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 ...
1
vote
0answers
134 views

Getting Group Policy identifier in PowerShell

Some of our computers have a random "local group policy" being set that forces them to check a nonexistent intranet server for Windows Updates instead of using WU over the internet as they should. ...
1
vote
0answers
221 views

Allow Powershell script executed on Exchange server to send mail - best practice?

I've got a single multi-role Exchange 2010 server and a need to execute a Powershell script on monthly schedule. And i really would like to send a report via email to some local company's mailbox by ...