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
1answer
31 views

How to get robocopy summary information involved in powershell?

I have a quick script written to compare file differences across servers, and then give a prompt for whether to mirror the changes. I'd like it to intelligently NOT prompt for copying if there aren't ...
7
votes
2answers
48 views

Powershell Remotely Delete PKI Certificates

I recently rebuilt my PKI and I would like to delete the certificates that were issued to all client machines across my network. Sounds like a job for Powershell! So I wrote this script to be ...
3
votes
3answers
2k views

What is the best powershell script to restore an SQL Database?

To restore an SQL Server 2008 database, I would lile to be able to just do something like this in powershell: ./restore.ps1 DatabaseName.bak Then the powershell script would by convention restore it ...
2
votes
2answers
61 views

Email results of PowerShell Script

I have a powershell script that check the certificate store for expiring certificates. It will display these results within the CLI. I want to modify this script to email the results of the output in ...
3
votes
2answers
45 views

How to list out Virtual Directories in IIS from the all the websites in PowerShell

I have hit a complete roadblock and cannot figure out how to print out the virtual directories for each website in IIS 8. I keep retrieving Applications and empty null argument errors and just can't ...
1
vote
2answers
418 views

How to put laptop to sleep with powershell/vbs/wmi/…?

I'd like to be able to put my laptop to sleep from the command line. According to Microsoft, the Win32_Battery WMI class has a SetPowerState method that looks like it should be able to do this, ...
5
votes
2answers
1k views

Issues with patching servers remotely using winrm and Microsoft.Update.Session

I have a network with windows 2003, 2008 and 2008r2 servers. I have a powershell script that I wrote to patch a local machine using the "Microsoft.Update" com objects. (Similar to Windows Update ...
8
votes
1answer
206 views
+100

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 ...
1
vote
1answer
33 views

Copying files from local server to remote server using powershell

Apologies if this has already answered directly or indirectly in SF. My requirement will be as follows: Move a deployment folder that has got files and subdirectories to a remote sever. Pass ...
0
votes
2answers
51 views

Powershell script:Loop/Array not retriving all AD Get Commands information: error “cannot bid parameter identity”

I have a powershell script that loops and retrieves AD information using get commands. At the moment its retrieving the selected information for account name and distinguised name. But if I add ...
18
votes
2answers
801 views

Is there a way to loop thru Windows 8 Apps and remove them all

Windows apps are annoying and I would like to remove them. Been playing around with Powershell and scripting and I wanted to know if there was a way I could use powershell to loop all the apps and ...
0
votes
2answers
3k views

How can I reset settings for Internet Explorer using a script?

I'm looking to reset Internet Explorer back to factory defaults using a batch file. I'd also like to delete: all Downloads, History, Cookies and Cache, plus anything else in a user's IE profile.
1
vote
1answer
12 views

PowerShell out-gridview cmdlet asks for PowerShell ISE but it is already installed

I am trying to use the Out-GridView cmdlet on a Windows Server 2008 R2 box. It complains that it can't run because I need to install the Windows Powershell Integrated Scripting Environment feature. ...
3
votes
0answers
37 views

Running PowerShell scripts as an Application in MDT 2013

Is there a way to make powershell scripts run under the applications list so that when you install from the MDT image you can select which scripts you want to run? I can run the scripts fine as ...
0
votes
0answers
56 views

Accessing Exchange server 2013 from window 7 using Remote PowerShell?

I am trying Remote PowerShell from Windows 7 to Exchange Server 2013. Following is the code snippet. public static void ConnectToPowerShell() { string password = "password"; ...
1
vote
2answers
19 views

Check management server on SCOM 2012

I have to check about 400 machines for the management server as we have moved from SCOM 2007 to 2012 and we need to check if the old SCOM 2007 server is still being pointed at. On an individual ...
0
votes
0answers
11 views

Automating Application Dependencies and Return Codes

I'm developing an end-to-end Application creation automation into SCCM 2012 from Orchestrator 2012. I've fully completed it using the MS PowerShell cmdlets as well as WMI manipulation, and PowerShell ...
0
votes
1answer
724 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 -> ...
2
votes
1answer
54 views

How can I create a VPN connection inside windows image?

Just like we can add driver packages to a windows image file can one add a vpn connection preferably thru Add-VpnConnection inside a .wim file ?
-1
votes
0answers
20 views

Windows server SAN/storage path availabilty check [closed]

I need to check the SAN/storage path availability for windows server. Can I have this done through powershell. If yes, how? Many thanks in advance. Regards, Chittaranjan
0
votes
1answer
34 views

Installing SQL remotely using Invoke-Command

i'm trying to install SQL Server 2012 on Win 2012 r2 server remotely via Powershell using Invoke-Command, but it fails with this error "Validation for setting 'SQLSVCACCOUNT' failed. Error message: ...
0
votes
2answers
1k views

Powershell delete files only from directory

I'm trying to delete all files (but not directories) in D:\MyTemp folder, I've tried: Remove-Item "D:\MyTemp" Remove-Item "D:\MyTemp\*" However, when I check, all the files are still there. What am ...
-1
votes
0answers
19 views

Auto search and download torrent from file names in a CSV file? [closed]

I lost my hard drive some time ago and the only thing I have left is a CSV file with all the sector refenences and most of the filenames. Some of them are either broken or missing characters. Here is ...
3
votes
1answer
36 views

Powershell DISM New-Windows Image: Using a CompressionType gives an error

PS C:\ProgramData\Microsoft\Windows\Hyper-V\BigHomie> New-WindowsImage -CapturePath K: -ImagePath C:\VHDImports\Win764.wim -name "BigHomies Personal Image" -Verify -CompressionType "Max" Throws ...
6
votes
1answer
112 views

ESXcli command timeout at 30 minutes

I am working on a powercli script to loop through each datastore in our environment and reclaim space on the thin provisioned LUNs. All LUNs in the environment are Dell Equal Logic. vCenter ...
1
vote
3answers
3k views

Get OS architecture remotely via PowerShell

Does anybody know how to grab OS architecture remotely from multiple Windows hosts via PowerShell?
1
vote
0answers
31 views

IIS 8: Setting the application pool username is ignored

I do this on IIS 7.5: Create an application pool, "testpool", and set the username and password to match one that exists in the AD. Then in powershell as administrator: Import-Module ...
0
votes
1answer
34 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
1answer
20 views

How to Resolve Hyper-V Disk Location to Drive Letter

When viewing cluster disk properties in Failover Manager or the physical path to VHD's in the settings of a VM in Hyper-V Manager the location is displayed by GUID. Is there a quick way find out ...
-2
votes
1answer
31 views

how can i find information about all exchange server in the organization?

Power Shell command Get-mailbox gives details of all the mailboxes on the server by which i am running this command. For example, i have two exchange server in my organization named server1 and ...
2
votes
1answer
726 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 ...
11
votes
8answers
721 views

Expire Files In A Folder: Delete Files After x Days

I'm looking to make a "Drop Folder" in a windows shared drive that is accessible to everyone. I'd like files to be deleted automagically if they sit in the folder for more than X days. However, it ...
-1
votes
1answer
20 views

Query AD Users from date [closed]

How can I query users in AD that have been added since an specific date and that their user logon name starts with UTX ? Im guessing I need to do it with powershell but I have very little knowledge. ...
0
votes
2answers
4k views

Office 365 Powershell - Export user, license type, and company field to csv file

I need to be able to export user name or email address (doesn't matter which), company (from the company field under the organization tab in a user account of the exchange admin console), and license ...
2
votes
1answer
4k 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
2answers
58 views

Copy-item FileSystem provider error

Copy-item cmdlet is not working as expected, i don't understand why. This is my code : $Source = "C:\folder1" $Destination = "\\172.22.0.115\c$\folder2\" $Password = ConvertTo-SecureString ...
13
votes
5answers
45k views

Need to add a “Wait” command to a Powershell script

Here is my current code: Write-output “ENTER THE FOLLOWING DETAILS - When Creating Multiple New Accounts Go to EMC hit F5(refresh) and make sure previous new account is listed before ...
0
votes
1answer
32 views

PowerShell won't rename an export .csv file

I am trying to rename the file export.csv to the $name but with a .csv extension instead of .file. The output is still $name.file. Import-Module ActiveDirectory $name = Read-Host "Enter Group Name" ...
3
votes
1answer
240 views

How to load MSMQ cmdlets in Windows 7?

Technet has a nice article (Windows PowerShell for Windows Server 2012 and Windows 8) listing a myriad of PowerShell cmdlets available on the latest OSes. Often there are easy (or not so easy:-) ways ...
0
votes
0answers
29 views

Make Azure Powershell cmdlet's available to team city

I have installed the Azure powershell cmdlet's via the web platform installer on my build server that is running TeamCity. However, when I setup a powershell build step I get an error: ...
-2
votes
2answers
60 views

Powershell script for retrieving AD information using piped Get commands then copy to csv file but getting “append” error

I am trying to run multiple Get Commands to retrieve AD information. I piped all of these commands and now I want to write the output to write all the the information ito one csv but at the moment i ...
18
votes
3answers
337 views

How do I delete this orphaned Active Directory computer object (preferably with PowerShell)?

I'm working from a Windows 7 workstation, with PowerShell v2.0, and trying to delete a particular (orphaned?) object from the LostAndFound container in a 2008 R2 FL forest and domain with the Active ...
-3
votes
0answers
46 views

How can I create an AD user via PowerShell prompting for options? [migrated]

I'm trying to create a PowerShell script which will create users based on template users I've created. The initial steps I'm trying to figure out are below: Upon execution of the script show a ...
1
vote
1answer
44 views

More efficient way to retrieve Office365 data via Powershell

I am trying to get mailbox statistics from Office 365. This is the current script: # Get credentials $O365Creds = New-Object -Typename System.Management.Automation.PSCredential -ArgumentList ...
0
votes
1answer
68 views

Grant user write access to DNS Server (Win2k8)

I want to remotely manipulate DNS records via Powershell scripts and I use the following script: $zone='company.local' $dnsrecord='dummyDNSrecord.company.local' $rec=Get-WmiObject -ComputerName ...
4
votes
2answers
817 views

Changing physical path on IIS through appcmd isn't activated

We have come across an issue on IIS 7.5 where we have a simple deploy system which consists of the following: Create a zip-file of new webroot, consisting of three folders: Api Site Manager This ...
10
votes
1answer
209 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 ...
0
votes
2answers
40 views

PowerShell - Add multiple strings to the same element in an array

So I have a array that I need to search through line by line and divide up by interfaces. My code loops through this file line by line. I want to split up the interfaces by the "!" character and add ...
1
vote
2answers
5k views

Exclude email address/recipient from Exchange 2010 dynamic distribution group

I'd like to exclude a single email address or recipient from an existing dynamic distribution group in Exchange 2010. The group is the generic "Everyone" group, and I'm interested in excluding the ...
0
votes
1answer
35 views

Pstools or Powershell or Both

I'm having a problem at the moment deploying and managing windows services and I'm looking for advice on the best course of action. Here's what I have working (below) - the problem is it's a bit ...