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)

1
vote
0answers
38 views

Powershell Script to audit all mapped drives in an OU

Similar to this post: http://powershell.com/cs/forums/p/9777/16289.aspx I'm looking for a powershell script that will let me query all the machines in an OU on my network and see what drives they have ...
0
votes
0answers
24 views

Setup an Account Password Reset to expire in Office 365 Exchange?

Is there a way to setup a user account so that it's password expires (in the next 5 minutes) for purposes of testing out a password expiration policy in Office 365? I'd like to do this on a test user ...
0
votes
1answer
908 views

How to save event logs “Network Policy and Access Services” on NPS server

We have a Windows Server 2008 R2 Enterprise server with NPS role installed in it. (We dont use NAP). Is there any way, we can save all the event logs in------ Event Viewer -> Custom Views -> ...
8
votes
1answer
298 views

How do I run my PowerShell scripts in parallel without using Jobs?

If I have a script that I need to run against multiple computers, or with multiple different arguments, how can I execute it in parallel, without having to incur the overhead of spawning a new PSJob ...
3
votes
1answer
92 views

Powershell Script to output all Distribution groups and nested groups into a csv

Hi I'm pretty new to powershell so I might be going about this completely wrong but I have to dump all our companies Distribution groups, their nested groups, and the users of those groups into a csv ...
2
votes
1answer
221 views

PowerShell startup script applied via GPO failing ambiguously

Script: $folder = "$env:HOMEDRIVE\TestFolder" New-Item -ItemType directory -Path $folder note that the same group policy error occurs when $folder is set to "C:\..." Execution policy is ...
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 ...
1
vote
1answer
55 views

Using Powershell to get a group of specific perfmon counters

I'm trying to set up a script that generates blg files every set amount of time, using powershell. I know this can be done using perfmon XML templates, but for this specific project I have to do it ...
0
votes
2answers
133 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 ...
-2
votes
0answers
20 views

ENABLE / DISABLE Local Group Policy Editor Settings in Windows Server 2008 r2 - Powershell [duplicate]

Inside Local Group Policy Editor in windows server 2008 r2 all settings under gpedit.msc>computer configuration > Administrative Templates > windows update , should be Enabled under In the Windows ...
-1
votes
2answers
271 views

Can I use Powershell to configure Local group policy settings in windows server 2008 r2

in Windows server 2008 r2 , for this manual process open run >gpedit.msc > computer configuration > windows templates > windows update > specify intranet microsoft update service location > ...
-2
votes
1answer
43 views

Powershell - Create folders and shares from a CSV

I have a repetitive task on Server 2012 R2 I'd love to automate. I have a CSV list of around 40 folder names I want to create (The names in this CSV changes). I then want to have those folders shared ...
0
votes
1answer
730 views

Strange behavior from Invoke-WebRequest in scheduled task

I'm running a PowerShell script that posts data to an internal webserver over HTTPS. The SSL certificate is not valid. I'm using [System.Net.ServicePointManager]::ServerCertificateValidationCallback ...
0
votes
0answers
32 views

Dropping attachments when importing millions of .MSG files into Outlook via PowerShell script

For various reason, I need to migration several million emails from one archiving solution to another. The only method of getting the data out of Solution A is by using a proprietary utility to dump ...
3
votes
1answer
129 views

How can I create Organizational Units recursively on Powershell?

I'm writing a Powershell script to populate all the company users to a Active Directory from a CSV file. The script uses the Powershell command New-ADUser and it should know, for every user, where is ...
0
votes
2answers
406 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
886 views

SQL Server: How to report error from a job's step of PowerShell type

I have a SQL job whose step of 'PowerShell' type does 'exit 1' if encounters an error i.e. $ErrorActionPreference='stop'; trap{"$_"; exit 1} Problem is, SQL Server doesn't pay attention to that exit ...
-1
votes
0answers
6 views

How would I go about setting php handler mapping and fastcgi parameters without using GUI

I like to be able to set php handler mapping and fastcgi parameters without GUI - would I be correct in saying, this can be done using Poweshell or if not, what would be best approach to do this. ...
0
votes
2answers
270 views

HTML not displaying correctly in email sent with PowerShell

I have a script which displays disk space on all servers on a HTML page and side by side sends email from the content of the HTML file saved. The HTML file is perfect, and the email displays the ...
2
votes
1answer
5k views

How to select a user and remove all groups they are a member of using Powershell (with Quest)?

I've read quite a bit online about this and thought I had found a solution, but it doesn't seem to be working like I would expect. I am wanting to get a user based on the username I input, then ...
0
votes
1answer
64 views

Querying for inactive users from a specific OU using powershell with the help of AD filter and LDAP filter

I am trying to get the list of all inactive members from a specific OU named inactive with the following queries: ...
0
votes
1answer
40 views

Copy specific files listed in a CSV file

I'm working in a Windows 2008 R2 Server and I'm trying to copy certain files listed in a csv file from one partition to another, headers are: ZipFile,Site.A,Site.B ZipFile column contains the ...
4
votes
1answer
80 views

Powershell Get-Process negative memory value

I was making some verifications with Powershell Get-Process cmdlet and got some weird values about some processes. I tested on a server with a SQL Server Instance running and consuming 3GB+ RAM as ...
5
votes
1answer
36 views

Race conditions in account creation script with email account and Office 365 sync--any good way besides time delay to resolve?

I have a powershell script that I use to create new users. Every year we add hundreds of interns, so automation is crucial. Someone in HR runs the script, so the script is supposed to be foolproof. I ...
1
vote
0answers
69 views

New-PSSession across domain boundaries

I am trying to bring up a virtual machine that needs to be able to create new sessions (with New-PSSession). The highly engaging about_Remote_Troubleshooting is my constant companion, of course! ...
0
votes
4answers
8k views

How to register a DLL using PowerShell without RegAsm

I have an ASP Classic application which references some Visual Basic 6.0 COM objects. One of these Visual Basic 6.0 COM objects reference another third-party DLL. The third-party DLL needs to be ...
-1
votes
1answer
35 views

Powershell Security Groups

Active Directory via powershell want to add users to a specific group. But that is a member of a particular group of users that other members do not want to be included in the relevant group. For ...
1
vote
3answers
366 views

Executing a git command using remote powershell results in a NativeCommmandError

I am getting an error while executing a remote PowerShell script. From my local machine I am running a PowerShell script that uses Invoke-Command to cd into a directory on a remote Amazon Windows ...
2
votes
3answers
684 views

Editing/Setting Mime Types with Powershell?

So I was wondering if there is a specific way to change/edit a mime type in IIS 7.5 using powershell? So far I have come across solutions to add mimetypes such as: ...
0
votes
1answer
44 views

I am unable to set the owner of a folder back to the user from my bat file

The following bat file is being used to fix permissions for Users in our organization. Everything works perfectly until we try to set the owner back to the user. takeown /F F:\Users\First.Last /R ...
0
votes
0answers
34 views

Servers Occasionally Hang After Using win32_volume WMI Class

I am using gwmi win32_volume to query remote machines and every so often I have a remote server that does not return from the query. It is like it is hung or in a stuck state. The command I am using ...
0
votes
0answers
30 views

How can I identify tiered storage volumes and their storage tiers

I've asked this over at stackoverflow and at technet without an answer so I thought I'd try here... Using either PowerShell or some C# magic how can I: A) Identify a volume drive letter that is ...
1
vote
1answer
90 views

What's the 64-bit equivalent of `Get-wmiobject win32_service`?

I'm using powershell to get a list of services from several computers to see which ones use the administrator to run. So far I have: Get-wmiobject win32_service | Select -Property startName, ...
3
votes
1answer
78 views

PowerShell - How to break a row with array into mulitple rows?

I am writing a PowerShell script to export users' information including the SharePoint Group(s) he or she belong to. Part of script show below: $web = Get-SPWeb $webURL $users = Get-SPUser -Web ...
0
votes
1answer
47 views

:Powershell Register-ClusteredScheduledTask from XML

I'd like to take my tasks on a non-clustered server, and import them as clustered tasks on a new cluster that has been built and tested. Here's what I have tried: cls ...
-1
votes
2answers
62 views

Can you use a powershell script to find all shares on servers? [closed]

I just want to know all shares on a server, or better all shares in the domain. I was hoping it was possible through a powershell script.
10
votes
2answers
848 views

How do I convert a vhd to a wim file?

I just setup and sysprepped a nice new VM, now I need to convert it to a wim real quick, to upload to my sccm server. For some reason, I can't change the VM properties to boot from a legacy nic for ...
2
votes
2answers
1k views

Comparing two specific properties of a CSV using Compare-Object isn't giving the expected results

I have a list of users from two separate domains. These lists are in CSV format and I only care about the SAMAccountName, which is a field in these CSVs. The code that I'm working with is currently: ...
2
votes
1answer
82 views

Errors when attempting to update source files, Server 2012R2 (errors 80073701 and 14081)

I have a Windows Server 2012R2 machine that I installed with Server Core, and then decided that I wanted to switch to GUI. I'll make the long story short: I ran windows updates, and now the source ...
0
votes
1answer
59 views

Using New-ADComputer's -ServicePrincipalNames

I'm trying to use the New-ADComputer -ServicePrincipalNames parameter with no success. $comp = New-ADComputer -passthru -name "server1" -path "ou=Org2,ou=Org1,dc=mydomain,dc=com" -DNSHostName ...
0
votes
1answer
39 views

How to execute a Powershell cmdlet as a specific user and save the return value in a variable?

How can I execute a Powershell cmdlet as a specific user and save the return value in a variable? What I got so far is this snippet Start-Process powershell.exe -Credential $credentials -NoNewWindow ...
2
votes
2answers
145 views

AD Group and Distribution Group with O365

I have a O365 with Exchange, and a local AD. I want to manage distribution groups and distribution groups members via PS scripts (that will run by scheduled task), that look users' AD attributes ...
0
votes
1answer
55 views

Exchange 2010 Search-Mailbox to delete Exchange Journal emails

I am using this PowerShell command to try and delete emails from our Exchange Journal, [PS] C:\Windows\system32>Search-Mailbox -Identity exchangejournal -SearchQuery ...
0
votes
0answers
43 views

How to Create a mailbox in Exchange 2010 with Linux

How do I create from a linux server (with winexe installed) a new mailbox for a user that's already known in Active Directory? When I try the following: ./winexe -U ...
1
vote
2answers
56 views

New-ManagedContentSettings - not working properly under Exchange 2010

I have a client that is divesting a business unit into a new AD forest, Exchange org, etc. We're using Quest tools to migrate users and mailboxes. However, I have to build the new infrastructure to ...
3
votes
2answers
411 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 ...
1
vote
1answer
226 views

Looking for a powershell script that can pull a file from a set of PC's and FTP

I'm looking to write a script (preferably powershell) that will essentially copy a file from a bunch of PC's and FTP it to a server. So the structure of the environment is that we have a file on ...
0
votes
2answers
116 views

Exception calling “UploadFile” with “2” argument(s): “The Content-Type header cannot be set to a multipart type for this request.” [duplicate]

I am working with a script that is supposed to first check if a PC is alive then FTP a file to a server. However, when running the script I am getting the following error: Exception calling ...
0
votes
1answer
17 views

How do I create a mailbox in powershell and determine which mailstore it creates it in?

I need to edit a powershell script that creates new users and add a section that creates them a mailbox, problem I am having is that I need it to check the first letter of the username to determine ...
-1
votes
1answer
74 views

Best Practices for User folder permissions [closed]

The following is my bat file. Is there a way I can substitute First.Last with usernames from a CSV file? My boss doesn't want to do all the users at once. He's afraid that something may happen so he's ...