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
0answers
21 views

Powershell query lastlogondate (lastlogontimestamp) returning mostly blank values (not matching the ADSIedit value for corresponding user attribute)

I am running a very short script to simply print out all users and their last logon time: get-aduser -filter * -property * |ft name, lastlogondate I noticed only a small handful of users have a ...
2
votes
0answers
21 views

How to allow access to winrs for non-admin user?

I have Windows Server 2012 (and Server 2008, but it is next priority) to monitor it using txwinrm. txwinrm library internally is using WinRS protocol. I have to monitor it using least privileged user, ...
1
vote
0answers
14 views

Automatically reconfigure WinRM HTTPS listener with new certificate?

I am looking to enable WinRM HTTPS listeners on all of our servers for secure communication when using CredSSP between servers to get around the double-hop issue. Setting this up is fine, we have ...
6
votes
1answer
105 views

Evaluating current ACEs on NTFS ACLs with PowerShell

We have a document management system that has million of files on a NTFS file system accessed through a network share. A single service account needs full permission to all of these files and the ...
4
votes
6answers
224 views

Powershell assistance for Active Directory Cleanup

I just started a contract to clean up an Active Directory system for a large company. I was told it would be quite the busy work but after reviewing the system and seeing how disorganized and messy it ...
3
votes
2answers
46 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
25 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
13 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
30 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
145 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
87 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
40 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
43 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
60 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
10 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
49 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 ...
1
vote
1answer
56 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
81 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
24 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
16 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
28 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?
0
votes
0answers
18 views

How can I make cygwin commands a priority over built in windows commands? [migrated]

If I run ls in powershell the windows built in ls function is run. how can I make cygwin ls run instead? I've tried moving cygwin/bin to top begin system path variable, but that didn't work. is ...
0
votes
0answers
36 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
21 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
19 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
57 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
41 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
37 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
1answer
60 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" ...
1
vote
0answers
41 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
17 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
42 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
78 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
38 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 ...
3
votes
1answer
59 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
38 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
22 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
55 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
90 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 ...
3
votes
2answers
36 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 ...
5
votes
1answer
63 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 ...
9
votes
5answers
303 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
92 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
79 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
78 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
27 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
56 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 ...
2
votes
0answers
29 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
41 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
23 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 ...