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)

0
votes
1answer
9 views

Powershell IIS works in command line but not in asp.net

I am trying to run a add-website script via asp.net. Where I want to be able to easily add new websites as an administrator. But I have the issue the command is not recognized. The command line ...
1
vote
1answer
17 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 ...
1
vote
2answers
54 views

Powershell Get-Process : Couldn't connect to remote machine

Been struggling with this for a couple days now. I'm getting the following error: PS C:\> get-process -ComputerName Win2012r2 get-process : Couldn't connect to remote machine. At line:1 char:1 ...
0
votes
0answers
36 views

Moving a group of students to another group and changing memberships after moved?

I'm a powershell noobie and need some help developing a script. I work for a school district and we current have our AD setup as *.*(server name) -> District -> *, , ...(school names by initials). ...
4
votes
1answer
32 views

My PowerShell $profile path has no $HOME prepended

I have PowerShell installed on two different Server 2008 R2 systems. On one system, $HOME is prepended to $profile, but on the other nothing is prepended: Server 1 (PowerShell 2) PS C:\> echo ...
0
votes
2answers
39 views

How do I check for a specific IP Address, and then change it if it does not exist?

I am trying to test for a specific IP Address and then change it if it is not there in Powershell. I am not sure what is wrong with my code: if($wmi.ipaddress -ne "10.0.0.15") {$wmi = Get-WmiObject ...
1
vote
1answer
33 views

Can I force powershell to ignore mouse input?

I'm running a basic Powershell script on a remote server, and while it's running, it ignores keyboard input completely. This is intended. When, however, you click anywhere in the Powershell window, ...
3
votes
1answer
44 views

Move-Item command only partially succeeding

I'm running a simple script to archive SMDR logs using Windows Server 2008 R2's Task Scheduler. The last line of the script is as follows -- dir c:\smdr -Filter *.txt | where-object {$_.basename -eq ...
1
vote
0answers
28 views

Get-MaskingSet in PowerShell 2.0

I'm trying to retrieve the current masking sets using PowerShell 2.0 on a Windows Server 2008 R2. Unfortunately, the cmdlet Get-MaskingSet does not exist under this PowerShell version. Are there any ...
3
votes
1answer
37 views

Edit local policy via powershell

i'm searching for a way to edit this policy via powershell : Computer Configuration -> Administrative Templates -> System -> Credentials Delegation -> Allow Delegating Fresh Credentials with ...
0
votes
1answer
48 views

PowerShell Script to Move ADUser to appropriate group based on its Department ID attribute

I am new to PowerShell and AD, I have a small task which I am finding difficult to complete. Can someone please help me here ? The task is as follows: There are 3 groups defined in AD, namely ...
-3
votes
0answers
39 views

You cannot call a method on a null-valued expression [closed]

Please find the latest script: function new-zipfile { param ($zipfile) if (!$zipfile.endswith('.zip')) {$zipfile += '.zip'} set-content $zipfile ...
1
vote
2answers
32 views

PSCX Invoke-BatchFile afterlife

I'm still rather new to PowerShell, so bear with me. Why does the PowerShell console behave wierdly after using the Invoke-BatchFile cmdlet of PSCX? C:\> cd C:\> cd .\Kellekek C:\Kellekek> ...
4
votes
2answers
170 views

How to check if an AD username is already used

Thank you in advance for your help. I found something related at the following link but was unable to find the solution I was looking for through here. Check existance of domain accounts with ...
3
votes
1answer
52 views

Windows Server 2012 R2 Powershell IP Interfaces Compartments

If I run Get-NetIPInterface -ifIndex 29 -IncludeAllCompartments, I get one Interface back. There are only 2 Compartments I checked this via @(Get-NetCompartment).Count. The Compartment IDs are 1 and ...
0
votes
1answer
14 views

Backup SharePoint (2010) documents only

I was wondering if it is possible to backup the files itself from SharePoint 2010 from all hosted sites? I can backup my entire virtual machine and the database, but i'm only interested in the ...
6
votes
0answers
248 views

What is the Proper Way to Share Credit on Script Authoring and Editing? [migrated]

In my scripting exploits I often check to see if a script has been written previously before I begin from scratch. Often I can at least find some of what I need through google or other means. I then ...
1
vote
0answers
21 views

Calling Physical Path Credentials for Web Applications in IIS

How would I call on the Physical Path credentials property for web applications in IIS using PowerShell? I can't print out the username or password, but I can print the logonMethod which uses the same ...
5
votes
1answer
71 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 ...
3
votes
2answers
83 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 ...
8
votes
2answers
69 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 ...
20
votes
2answers
855 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 ...
3
votes
2answers
58 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
1answer
32 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. ...
1
vote
1answer
53 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 ...
3
votes
1answer
70 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
17 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
42 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: ...
1
vote
2answers
26 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
86 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"; ...
0
votes
1answer
47 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 ...
1
vote
0answers
38 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 ...
2
votes
1answer
25 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
34 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 ...
-1
votes
1answer
22 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. ...
3
votes
1answer
42 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 ...
7
votes
2answers
184 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 ...
0
votes
2answers
63 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 ...
0
votes
1answer
41 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" ...
0
votes
0answers
30 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: ...
0
votes
2answers
68 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 ...
-2
votes
2answers
66 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 ...
1
vote
1answer
49 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 ...
-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 ...
10
votes
1answer
229 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
46 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 ...
0
votes
1answer
45 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 ...
0
votes
1answer
70 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 ...
3
votes
1answer
66 views

Configure and monitor Windows 2012 DHCP server with Powershell

We've recently been working with the documentation here to set up some access policies for a new DHCP server. I've been able to successfully import 600+ records with the Set-DhcpServerv4Policy -Name ...
3
votes
2answers
75 views

Ensure drive is mapped at login on laptop with strictly wireless

So, $software runs on a 'server' (windows client w/ file sharing to share out the db folder), and laptop client has the drive mapped and $software also installed. This is the vendor's recommended ...