PowerShell is Microsoft's new scripting language in 2006, and significantly upgraded in 2009. It allows interpreted scripts based on PowerShell cmdlets and .NET primitives.

learn more… | top users | synonyms (1)

3
votes
2answers
145 views

Enumerate Windows DNS Server Zone attributes via shell

I'd like to use a command-line tool to list a (primary) zone's configured secondary servers, if any. Dnscmd comes close with: dnscmd server /ZoneResetSecondaries:[list of secondaries] But, I ...
1
vote
2answers
35 views

Debugging powershell init

My problem is that I just reinstalled my system and have installed heaps of packages via Chocolatey. However now when I launch powershell, something changes the fonst type and size inside the console ...
1
vote
0answers
120 views

Running New-RDSSessionDeployment Remotely

I'm trying to script the setup of a remote desktop deployment into Azure. I'm using Powershell remoting to connect to the WinRM endpoint on the VM's and execute remote Powershell. For the most part ...
0
votes
1answer
116 views

What rights should non-admin user have to run Get-WmiObject?

I am trying to monitor windows machine with the help of wmi and powershell remoting. I managed to successfully start remote session with that machine throught non-admin user account, but now I have a ...
3
votes
1answer
177 views

What is causing the Collateral damage when deleting old profiles?

#Get user names that have logged onto workstation $Users = gwmi win32_networkloginprofile | where {$_.name -match "EXP\\"} | where {$_.name -notmatch "srvtasksched"} $Users | foreach{ $Name = ...
6
votes
3answers
1k views

How to find the creation date of a local user account?

I would like to get the creation date of a local user account (Win 7 if it matters). I've looked at the following WMI objects (and google of course): Win32_UserAccount Win32_NetworkLoginProfile The ...
2
votes
1answer
117 views

Windows 2008 Server R2 Command Prompt/Power Shell Slow Scrolling

I'm having an issue with various Windows 2008 Server R2 machines scrolling very slowly using the command line or Power Shell. For instance, if I type "dir", I see my contents being displayed 1 line at ...
3
votes
2answers
275 views

Best way to deploy Powershell 4.0 on Windows 7 sp1 and server 2008

I am planning to deploy powershell 4.0 on all Win 7 and server 2008 and 2008R2. I did some research about this, but couldn't find the official way to do it. I can just use batch file or GPO to ...
1
vote
1answer
224 views

Why is my Powershell script returing extra output when run by Nagios NRPE?

I have a Powershell script that I'm running via nrpe as an external script. The windows server (2008) is running nsclient++ (nscp.exe) v 0.4.1.102. The return section of my powershell script looks ...
0
votes
1answer
82 views

LocalGPO compare fails with error

I was trying to run LocalGPO on my Windows 7 system with its "/Compare" option to compare the current policies with that of a backup. However, the process fails with an error in a Windows Powershell ...
0
votes
0answers
353 views

“powershell has stopped working” on PS exit after creating IIS User

On a Windows Server 2012 box, I'm using PS to create a new IIS User (for automated deployments using MSDeploy). The command itself appears to work fine -- the user is created -- but as soon as I exit ...
2
votes
1answer
1k 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
3answers
2k views

GPO: Run powershell logon script after explorer.exe has been loaded

I know there is the GPO setting "Computer Configuration => Admin. Templates => System => Scripts => Run logon scripts synchronously". This however ensures that logon scripts run before windows ...
2
votes
1answer
74 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 ...
1
vote
0answers
42 views

Remotely edit winrm conf file

Im trying to edit the winrm conf file on remote computer. I dont have the possibility to use GPO edit so i must find another way. I've tried to set the configurations that i need by using the "winrm ...
1
vote
1answer
159 views

What do the error messages and codes mean when creating and installing Managed Service Accounts?

When using the PowerShell Cmdlets for creating and installing Managed Service Accounts, certain errors can be thrown. What does each error mean?
2
votes
1answer
792 views

Modify IIS web.config using PowerShell

I'm trying to modify the web.config using PowerShell. So far, I'm able to replace the Connection String using: Set-WebConfigurationProperty -pspath "IIS:\Sites\$Name\WS" -filter ...
0
votes
1answer
113 views

Change an IISExpress site's physicalPath on the command line

What's the easiest way to accomplish this? I see there's lots of examples for appcmd relating to IIS proper, and using powershell for same, but I can't see an API of sorts for reconfiguring the ...
0
votes
0answers
39 views

ACL PS Script - hangs on 08 R2 PS v3; works fine on W8 PS v4

This script was designed to make application of permissions to a new server much easier. It is not doing that currently :( For some reason it works just fine on my Win 8 machine, where I made it. ...
-2
votes
1answer
1k views

How To List All Computers Operating System On A Network In Powershell

I am looking for a script to show all the machines, hostnames, and OS versions on my domain. I have found a few scripts, but none of the scripts that I have found will do both. Here is an example of ...
2
votes
1answer
348 views

Powershell: Piping input to Set-Acl

have a messed up folder with inconsistent ACLs which I need to uniform. I hoped to accomplish this with powershell. So I'm trying to search for all files missing the required group and applying the ...
1
vote
1answer
208 views

Nesting PowerShell DSC configurations from different files

If I nest DSC configurations in a single file like this, it works fine: Configuration Secondary { Param ($SomeParameter) Environment Test { Name = $SomeParameter Value = ...
0
votes
2answers
405 views

Powershell script can't open a file when run as a scheduled task

Cross-posting from Stack Overflow because there are probably many more Powershell experts on Server Fault. My Powershell (2.0) script has the following code snippet: $fileName = "c:\reports\1.xlsx" ...
2
votes
1answer
276 views

Can't shut down HyperV VM with Powershell despite admin rights

I am attempting to use a script that shuts down my Hyper-V VMs, copies their VHDs to a target share, then boots them back up. I found the script on spiceworks just a couple days ago. I always receive ...
0
votes
1answer
123 views

clean-mailboxdatabase error : unable to sync mailboxes with DS

Trying to run a script to clean exchange databases. When i run the clean-mailboxdatabase cmd-let I'm getting the following error: Exchange is unable to clean the database that you specified...Unable ...
2
votes
2answers
274 views

Powershell ForEach-Object : Cannot bind parameter

I am trying to get the owner of a process using this code: (Get-WmiObject -class win32_process | where{$_.ProcessName -eq 'explorer.exe'}).getowner() | Foreach-Object user | out-string This works ...
1
vote
2answers
983 views

powershell and using get-eventlog

I am trying to create a script that pulls failed log on attempts for certain events in the past 24 hours but I cant figure out how to pull the account information out. User is Null all the time so ...
0
votes
2answers
160 views

How to collect remote windows logs as a non-admin

I am trying to collect logs from remote windows machines (Windows Server 2008R2 and Windows 7) and I can't figure out a way to do so in such a way that I should still be able to accomplish this ...
8
votes
1answer
293 views

How to accept EULAs for Software updates deployed through SCCM using Powershell

I'm trying to use the Start-CMSoftwareUpdateDeployment cmdlet to deploy a software update group to an existing collection. PS WHO:\> Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName ...
0
votes
1answer
146 views

Auto-Tagging EC2 Instances in AWS (Windows Servers only)

I am looking for some guidance from the serverfault community. We are spinning up several new AWS instances (windows server 2008/2012) over the next few days. We have a naming convention in place for ...
0
votes
1answer
123 views

List current Principals in group Managed Service Accounts

Is there a way to list the current list of all the groups and/or hosts in the PrincipalsAllowedToRetrieveManagedPassword property of a gMSA (group Managed Service Account)? There isn't any help on ...
2
votes
1answer
204 views

Drainstopping NLB via powershell remotely

This question was asked by a colleague on SO here, though it was suggested that we ask it here instead - apologies for the cross posting. Server is Windows Server 2008 R2 - UAC is disabled on the ...
0
votes
0answers
823 views

OpenVPN: Setting DNS & WINS servers to Windows client, without DHCP

I have a few Windows 7/8 clients connecting to a Linux OpenVPN Server (tap). I'd like to set the clients' DNS and WINS servers upon connection. The OpenVPN isn't acting as DHCP server; there is an ...
4
votes
2answers
212 views

How to force DSC to execute all configurations (Packages) even when a restart/reboot is required

From MSDN RebootNodeIfNeeded: Certain configuration changes on a target node might require it to be restarted for the changes to be applied. With the value “true,” this property will restart the ...
6
votes
1answer
210 views

DSC, how to know if after running the configuration a reboot is required

So I'm using DSC Push mode I have about 200 deployments per day to several environments (DEV/INT/QA/PROD) Every time that I deploy I want to make sure that each server is configured correctly So ...
11
votes
5answers
3k views

Powershell - Retrieve current domain user's full name

Using Powershell, how can I get the currently logged on domain user's full name? Not only its username. Thanks EDIT: without the need of the activedirectory module!
1
vote
2answers
140 views

Powershell Array - same location combining

I have a script that returns the following information Analog Phones IP Phones Location ------------- --------- -------- 0 883 Site1 413 0 Site1 0 ...
1
vote
3answers
91 views

Displaying all groups that a user from another domain is a member of

My team and I are stumped on this one. We have two domains at work, OldDomain and NewDomain. We are working on migrating from OldDomain to NewDomain as mandated by ParentCompany. The trust is one ...
3
votes
2answers
378 views

Can you use WMI to determine if a connection gets its DNS servers from DHCP?

The DNS server search order for a network interface can be read from Win32_NetworkAdapterConfiguration like this in Powershell, or programmatically using .Net ManagementObjects: > $NICs = ...
0
votes
0answers
221 views

Script to clean out old messages from Journal mailbox after exporting email to .PST

After using the following script to export email to a .PST file I'm wanting to clean out the Journal email box called "JournalMailbox": New-MailboxExportRequest JournalMailbox -FilePath ...
1
vote
1answer
64 views

Does Microsoft Exchange 2010 have two kinds of Distribution Groups?

I was told to add someone to a Distribution Group and when I ran: Get-DistributionGroup -ResultSize Unlimited | Select-Object -ExpandProperty Name from Exchange Management Shell I didn't the ...
1
vote
0answers
90 views

Enter-PSSession returns PSRemotingTransportException

When I try to connect to a distant server using Enter-PSSession, I have a PSRemotingTransportException. It says that the user is either unknown or associated with a wrong password. It works with ...
0
votes
1answer
899 views

Create network shared folder using Powershell on Windows 7

I need to create a shared network folder on windows 7 using PowerShell - I cant get access to New-SmbShare as this is for windows 8 and Windows 2012 Server - any examples would be great. Am I limited ...
0
votes
1answer
106 views

New-ADUser -Path syntax?

Where can I find a detailed explanation of the -Path parameter of the New-ADUser command? I want to specify a rather detailed path without calling Set-Location many times to specify where I want the ...
0
votes
1answer
74 views

Is it possible using powershell or batch scripting to change the meeting organizer for a lot of meetings in one go?

We have an exchange 2003 server, and now for one of my users I've created a separate mailbox for organising meetings for all users. Now I want to move all her existing meetings scheduled for all users ...
0
votes
0answers
59 views

Exchange powershell command set-MailboxJunkEmailConfiguration not responding

I recently needed to remove an address from the blocked sender list on an exchange 2010 server. No biggie I thought and tried it out using this command: set-MailboxJunkEmailConfiguration -identity ...
0
votes
0answers
72 views

Scheduled task deleting itself

I am using PowerShell to create scheduled tasks on my local machine, the Scheduled Task runs a PowerShell script to PowerShell remote into a server and copy files. When I run the Scheduled task using ...
3
votes
2answers
577 views

Powershell - Find users belonging to more than one AD group

I'm new to AD and Powershell so please forgive me if I use the wrong terminology. I have a series of 50+ Active Directory groups called "ABC-something". Every active user needs to belong to exactly ...
1
vote
2answers
1k views

Powershell scan for network attached printers

Currently I'm working on creating a PS script to scan a network and retrieve all of the Windows Servers, their product keys, SQL Server product keys, CPU, RAM, Network Shares and Services on all the ...
0
votes
0answers
94 views

ssh from osx to windows server: how to increase buffer size?

I need to allow mac users to connect to a Windows Server 2008 machine via ssh. I am using freesshd as my ssh server, and have set powershell.exe as my command shell in freesshd (so that they can use ...