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
3answers
105 views

Adding remote machine to AD via Powershell

So I have a powershell script, Add-Computer -ComputerName $computername -LocalCredential $computername\admin -DomainName $domain -Credential domain\$username -Force -Restart So if I have a machine ...
0
votes
1answer
52 views

Powershell pipe exporting to csv is loosing data

I'm trying to write a script that will take input from a .txt file of IP address. Do a reverse DNS lookup to get the hostname of the IP address and then export that data into .csv file. Here is what ...
0
votes
0answers
127 views

Parameterizing powershell parameters in scheduled tasks

I have a bunch of powershell scripts that are kicked off via scheduled tasks at various times. The script are run multiple times with different arguments. Also admins unfamiliar with scripting needed ...
3
votes
1answer
230 views

PowerShell remoting doesn't work if computer name contains dot

I have one system where I cannot connect to remote computer (or to itself remotely) using PowerShell when computer name contains dot. For example, this works: Enter-PSSession HostA -Credential ...
4
votes
2answers
91 views

How can I assign IPv6 addresses based on existing IPv4 addresses?

I have several hundred Server 2008 R2 machines with static IPv4 addresses. I'd like to enable IPv6 on each interface, and then automatically assign IPv6 addresses to them based on their existing IPv4 ...
0
votes
0answers
28 views

Run active directory logon script as an admin user [duplicate]

I have a logon (powershell)script for a certain non-admin user. The script retrieves some files from a server and places them in certain folders on the machine (and some other stuff as well). I don't ...
1
vote
1answer
62 views

How do I suppress “Yellow Text” from Exchange Set-Mailbox, when -WarningAction doesn't seem to work?

I am doing a bulk import, setting or updating attribute6 on 1,000 users in AD. I'm using the following Exchange commandlet to accomplish this: [PS] C:\>set-mailbox -Identity user@company.com ...
0
votes
1answer
48 views

MailboxExportRequest ContentFilter is “Received -ne $null” when querying by date

I am trying to export a mailbox to a PST. All email that was received before yesterday is what I am trying to export. $y = ((get-date).addDays(-1)).ToShortDateString() $exportRequest = ...
5
votes
2answers
238 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, ...
2
votes
2answers
1k views

Export Windows Server configuration to powershell script?

I'm looking for a way to export role/feature configuration to a scriptfile, like powershell. Lets say you've installed the DHCP-Role. You configure the scopes, reservations and all that stuff you ...
1
vote
2answers
759 views

Copy a user's organizational unit to a new user

My goal is to copy an existing user, including OU placement in the AD tree. So far i have this: $SName = Read-Host "Please Enter the login initials of the source user " $U = Get-ADUser -Identity ...
4
votes
1answer
342 views

PowerShell: Copy-GPO failing with HRESULT: 0x8007000D

While trying to run the Copy-GPO cmdlet to copy a Group Policy Object using a predefined Migration Table I am receiving this exception: System.Runtime.InteropServices.COMException (0x8007000D): The ...
3
votes
2answers
1k views

How to get a list of emails older than 2 years in Exchange Database, sorted by user, using Powershell?

We are currently looking at archiving emails and revamping our retention policy. The big question is (for the legal department), how far back do we want to save? Currently our users have a huge ...
5
votes
1answer
645 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
1answer
119 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 ...
4
votes
3answers
4k views

Enabling Powershell Remoting, Access is denied?

I am trying to enable Powershell remoting on a Windows 2008 R2 Server, running in workgroup mode. I ran the command Enable-PSRemoting in the PowerShell Console. PS C:\Windows\system32> ...
0
votes
3answers
405 views

Enable-PSRemoting on Windows Server 2008 R2 error

When giving the command Enable-PSSRemoting with or without the -Force parameter this error occurs Set-WSManQuickConfig : More data is available. At line:50 char:33 + Set-WSManQuickConfig ...
6
votes
3answers
559 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 ...
3
votes
4answers
3k views

Disable a specific ethernet card via batch commands on Windows

What I would like to do is disable a NIC based on the connection name (aka: what you see in the "network connections" window, or what you would use with netsh commands). I know enabling/disabling can ...
4
votes
6answers
358 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 ...
4
votes
2answers
108 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
170 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 ...
1
vote
2answers
31 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 ...
3
votes
2answers
81 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
1answer
111 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 = ...
1
vote
1answer
143 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 ...
3
votes
1answer
171 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 = ...
1
vote
0answers
74 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
79 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 ...
2
votes
3answers
1k 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 ...
0
votes
1answer
68 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 ...
1
vote
3answers
2k views

Powershell Win32_NetworkAdapterConfiguration Not “seeing” PPP Adapter

I am trying to get the IP of a PPP VPN network connection, but Win32_NetworkAdapterConfiguration does not seem to "see" it. If I interrogate all adapters using my script, it will see everything but ...
2
votes
1answer
75 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
113 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 ...
0
votes
1answer
52 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 ...
1
vote
2answers
544 views

New-MoveRequest - How to assign -TargetDatabase dynamically

I am in progress to migrate (approximately) 5000 mail-objects and I need a way /script /command that will allow me to utilize the New-MoveRequest CMD-Let in combination with the possibility to ...
0
votes
1answer
446 views

DPM 2012 running powershell script in task scheduler

I'm having a problem running a custom PS script I created to attach systems into the console. My PS script works when i'm running it interactively in the DPM Management Shell. I was referencing this ...
4
votes
1answer
252 views

PowerShell DSC Group Resource - “Could not find a principal with the provided name”

I am trying to use PowerShell DSC to add a domain group to the local administrators group. Here is the code: Configuration TestSetup { Node localhost { Group Administrators { ...
1
vote
1answer
570 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
1answer
48 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
1answer
743 views

(Powershell) Method to return a list of groups where a specific user has 'write member' security

We use a piece of web-based software that users can log on to in order to manage access to shares controlled with AD groups. The list of groups a user can manage are the groups on which they have ...
1
vote
0answers
31 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
3answers
86 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 ...
1
vote
1answer
93 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
145 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 ...
0
votes
0answers
234 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
0answers
31 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
393 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 ...
0
votes
2answers
110 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 ...
0
votes
1answer
206 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" ...