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)

0
votes
2answers
50 views

How to plan a script to be executed at session end inside a powershell script?

I am writing a login script in Powershell which install a amount of printers, depending on the user currently loggin into Windows 7. I would like this user to remove the printers it have installed as ...
0
votes
1answer
99 views

Page files size from CSV

I've got the following script, that checks the page file size on a remote server, is it possible to run this against a CSV file of hostnames? clear $strComputer="computername" ...
0
votes
0answers
52 views

Unselectable (?) Property in IIS Powershell Module

dir iis:\apppools Gives 3 properties: Name, State and Applications. I'd like to isolate "Applications" but for some reason it's nowhere to be found on the Get-Member list. TypeName: ...
10
votes
2answers
2k 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 ...
3
votes
2answers
489 views

Use WMI to remove a page file

I can modify page file settings via WMI like this PS D:\> gwmi win32_pagefilesetting MaximumSize Name Caption ...
5
votes
2answers
2k views

Powershell import-module webadministration

Every time I execute this command invoke-command -computername REMOTEPC -scriptblock { import-module WebAdministration; new-item "$env:systemdrive\inetpub\testsite" -type directory; New-WebSite -Name ...
6
votes
5answers
4k views

Query schtasks using Powershell

On a Windows7 machine I am trying I can run a query to view all the scheduled tasks using schtasks.exe This is fine but I would also like to filter the result set using something like schtasks ...
3
votes
1answer
20k views

List All Groups and Their Members with PowerShell on Win2008r2

I am new to powershell, but I've been reading manuals and practiced a little bit. My objective is to List all users in all Security Groups under specified path. I have found the way to do it: ...
2
votes
1answer
174 views

cUrl for an HTTPS address/domain times out unless previously accessed from browser

I've lost a couple days to this problem and hope it sparks a thought from someone. I am integrating several systems together using Powershell scripts. One of the two services I am connecting to ...
2
votes
3answers
401 views

Powershell authentication over VLAN

Problem I'd like to enable remote powershell scripting for all workstation hosts on a VLAN. There's no Active Directory or Directory services whatsoever. So HOST A on subnet 192.168.1.x would like ...
0
votes
2answers
91 views

Pipeline input to functions - Write-progress and Alias

I'm currently working on a script to gather a whole lot of information from computers in a domain. As I want to show how far it has come along (the task may run for hours or minutes) I wanted to use ...
2
votes
1answer
64 views

Need to format power shell output

I am pretty new to powershell and have been trying various ways to split the results from the following powershell script I found but have had no luck. At the moment the script list everything in 4 ...
6
votes
1answer
187 views

How can I generate a list of the security groups a set of users belong to?

I have been asked to generate a list of the security groups (so specifically not the distribution groups) that a list of approximately 50 users belong to. I have a list of users, users.txt that ...
0
votes
2answers
1k views

PowerShell Firewall Management

I have a bunch of machines that I need to enable Remote Scheduled Tasks Management (RPC), Remote Scheduled Tasks Management (RPC-EPMAP), and Windows Management Instrumentation (WMI-in) on for GPO ...
2
votes
2answers
63 views

Find last run defrag WMI or Reg key

I am trying to discover if there has been a defrag run on our servers. To save myself going to each one and loading the defrag program and checking the "Last Run" column I thought WMI might have this ...
2
votes
2answers
4k views

Powershell script to delete sub folders and files if creation date is >7 days but maintain parent folders of sub folders and files <7 days old

I'm currently using the Powershell script below to delete all files directories and sub directories of "$dump_path" that are seven days or older based upon the creation date and not modified date. ...
1
vote
1answer
38 views

Give users access to Set-Mailbox command to change -ProhibitSendReceiveQuota -Prohibit SendQuota and -IssueWarning in Exchange 2010

Is it possible to give users access to Set-Mailbox command to change -ProhibitSendReceiveQuota -ProhibitSendQuota and -IssueWarning parameters on every mailbox on Exchange server 2010 without giving ...
0
votes
3answers
64 views

AD Management via powershell on 2008 enterprise

windows server 2008 enterprise, without hyper-v x64 We have a client server that I am trying to automate some functions on using power shell directly on the server. I have the gateway service ...
0
votes
1answer
149 views

Unrecognized element 'ProviderOption' when trying to use Powershell Set-WebConfigurationProperty

I am trying to build a Powershell script to automate connection string changes to our deployed web applications. I am trying to use the WebAdministration command Set-WebApplicationProperty but am ...
0
votes
1answer
168 views

Exchange Powershell - Creating Distribution Groups

I'm trying to add some new distribution lists to exchange using the below. C:\>Import-CSV "c:\external.csv" | foreach {New-DistributionGroup -Name $_.name -Type $_.Type} I've created a CSV file ...
0
votes
1answer
57 views

Script for finding users who does not have specific aliases entry - not working

I wrote the below script for finding users who does not have specific aliases entry in the exchange account, but it returns all user in the OU. can someone help. thank you Get-Recipient ...
0
votes
0answers
24 views

connect-nacontroller - slow connection

I've recently started working with Powershell and the Netapp Data-Ontap Module V 3.0 When running 'connect-nacontroller', there is a very long pause before the connection is made and I am able to ...
1
vote
1answer
43 views

no mof generated with composite resource - powershell dsc

I'm having an issue where the .mof file doesn't get generated when using a composite resource in it.The directory gets created fine and no errors are shown. It might be a simple issue to some fresh ...
1
vote
3answers
337 views

Powershell - Set-ClusteredScheduledTask - Error “Incorrect function.”

I'm experimenting with Powershell to add a ClusteredScheduledTask on a clustered server (Win 2012/R2) Technet sample code gives error: #canned exampled from ...
0
votes
1answer
260 views

Repeat the csv header twice without “Append” (PowerShell 1.0)

I have prepared a PowerShell script to export a list of system users in CSV format. The script can output the users list with Export-csv with single header row (the header row at top). However my ...
4
votes
4answers
493 views

Is it possible to disable msiexec help GUI?

I'm automating unattended retrieval & installation of specified .msi packages with a powershell script but if the command is invoked with syntax errors the msiexec will wait indefinitely for an OK ...
1
vote
3answers
167 views

New-ADUser -Name Length too long

I need to add about 500 users to an OU in AD I have scripted out everything I need, however, it gives the error: the name provided is not a properly formed Here is the script New-ADUser -Name ...
0
votes
1answer
101 views

Get login name using email address with Powershell

I need a powershell script, to get login names using the e-mail address. i am having a note with e-mail address of some users. I want to get login IDs and account information of the users in the ...
1
vote
0answers
47 views

Logman user switch confusion

I'm setting up a powershell script that installs a logman counter on several servers that are in dire need of some performance monitoring. The documentation states that the -u switch works with ...
3
votes
2answers
317 views

Must create PowerShell script to change Password Expiry and Date to change next password

I've been tasked with creating a script that reads in a file a list of Active Directory user IDs and then clears the flag for Password Never Expires. In addition, my security officer doesn't want the ...
-3
votes
1answer
46 views

Install .EXE without displaying windows [closed]

I want to install an .exe file without displaying windows, by supplying value to parameters ? How can i do from Commands or script not in UI ?
9
votes
3answers
5k views

How do I find orphaned computer objects in Active Directory using PowerShell?

How can I find all computer accounts in my Active Directory domain that have been inactive for x days using PowerShell? Note that I do actually know how to do this. This is a self-answered ...
3
votes
2answers
176 views

What do the contents of PowerShell's $PSVersionTable represent?

If I echo $PSVersionTable in PowerShell, I get what appears to be multiple bits of version information. The name's of the properties are CLRVersion BuildVersion PSVersion WSManStackVersion ...
1
vote
3answers
115 views

24 hour expiration of first password

EDIT** I'm thinking of running a scheduled task at the end of every workday to retrieve all accounts who have never logged on and disabling their accounts. Please excuse any syntax errors. I may very ...
0
votes
1answer
182 views

Puppet not running powershell script on Windows 2008 server

The puppet agent on my Windows VMs is not executing powershell scripts. I have tested it with a very simple script as well. The script is stored on C drive as test.ps1. Its contents are as follows:- ...
1
vote
1answer
123 views

Advanced function - Getting local security group members of computer objects

I'm trying to compile a list of groups that have access to a set of computers/servers in our organization, with regards to MSDN license reporting.. :-/ basing my work out of the Hey Scripting Guy's ...
4
votes
3answers
866 views

How can I create a windows shutdown script from powershell/command-line?

I've read the TechNet pages that describe using computer/user startup/shutdown scripts, and that's great, but I'd like to create those scripts via the command-line (and not have to click around in ...
3
votes
1answer
209 views

How is the computer chassis type assigned

So you can use Get-WmiObject win32_systemenclosure | select chassistypes To get the Windows chassis type for a machine as defined in this list: ...
1
vote
0answers
67 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
43 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 ...
3
votes
1answer
464 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
533 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 ...
1
vote
1answer
129 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
178 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 ...
-1
votes
2answers
2k 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 > ...
-1
votes
1answer
141 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
1k 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
60 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
372 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
526 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" ...