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)

4
votes
3answers
493 views

Update-Help on a Server-core behind a proxy

I'm struggling to update the help on a server-core box behind a proxy. I have seen that it was possible to set winhttp proxy with netsh to solve the problem, but powershell update-help clearly don't ...
1
vote
3answers
6k views

Using Powershell's Invoke-command to install .exe on remote computer

I have an .exe I would like to install on a large farm of Windows Server 2008 computers. I am attempting to use Powershell remoting. I have this command which works locally: invoke-command {& ...
0
votes
3answers
731 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 ...
0
votes
3answers
368 views

How can I export the results of my script to file?

I need to get some details out of hundreds of XML files that were written for reporting. The script below provides the correct results, but I want them in file, cvs, xls, or txt so I can provide a ...
0
votes
3answers
293 views

Want to create two VM with same VHD running at the same time

can I create several machines each having an exact copy of an existing vhd and running at the same time . I have a an OS installation ready and I just want to copy the vhd so that other machines will ...
8
votes
2answers
928 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 ...
5
votes
2answers
1k 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 ...
5
votes
2answers
2k views

Why do weekly tasks created via PowerShell using a different user fail with error 0x41306

We have some scripts that create scheduled jobs using PowerShell as part of our application. When testing them recently, I noticed that some of them always failed immediately, and no output is ever ...
4
votes
2answers
648 views

Why am I getting unauthorized errors with Powershell get-winevent?

I'm a domain admin equivalent, I've tried running in an elevated console (right-click> run as administrator), and I'm consistently getting errors when executing get-winevent -logname application | ...
3
votes
2answers
254 views

Is it possible to get CCM Updates Schedule using Powershel or VBScript?

I want to be able to check the CCM Updates Schedule as seen in Configuration Manager Updates tab. I've been looking around on google and I've not been able to find a consistent answer to this. I ...
2
votes
2answers
249 views

Look up where a NTFS group is used

We are doing some AD clean up and migrating or deleting old AD groups and replacing them with our current naming stranded in AD. The challenge that we are running into is making sure we have the we ...
2
votes
2answers
132 views

Powershell: Consistent modules accross all servers/workstations

Whats the best way to get consistent modules across our servers and workstations. To put it another way: I want to be able to write a powershell script and have it run on all machines meaning each ...
1
vote
2answers
45 views

Duplicate current powershell session in a new window

Is it possible to duplicate a powershell session in a new window? I often find that I've created environment variables, activated a specific python virtualenvironment, defined one-off functions, ...
1
vote
2answers
176 views

Getting list of users indirectly members of an AD group through LDAP

I'm having a bit of a problem with LDAP search that should specify whether a user is a member of a given AD group or not (recursively). Basically, what I'm doing is issue a LDAP search with the ...
1
vote
2answers
127 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 ...
1
vote
2answers
959 views

Power shell script to fetch disk space on all servers in timely intervals

I got a Powershell script from here which will export Disk Space usage to html file. I want the scritp to give usage in timely intervals say each 15 mins or 30 mins. is there any way we can mod this ...
1
vote
2answers
931 views

Start-BitsTransfer Works when triggered manually from powershell but not using a windows service

I'm using BITS to transfer file from one windows 2008 R2 server to the other. When I run the command manually from powershell or regular command line it works perfectly. Now when I use the same ...
1
vote
2answers
563 views

PowerShell filter files by date in name

I have many files with different names per day. How can I filter them by the date in their name? For example: app_20130505.log app_20130506.log app_20130507.log app_20130508.log app_20130509.log ...
1
vote
2answers
696 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 ...
1
vote
2answers
670 views

Powershell - winrrm using ip address instead of computer name

Is it possible to set up winrm using IP and address instead of the computer name. The computer in question is only I have only been able to set winrm up for a computer in the same domain like this: ...
1
vote
2answers
270 views

Listing services on remote machine locks me out of the machine

I run a powershell command to list all of the services on a remote matchine: $b = 0; get-wmiobject win32_service -computer $computerName -credential $cred | select-object Name, ...
1
vote
2answers
2k views

powershell v2 remoting - How do you enable unecrypted traffic

I'm writing a powershell v2 script that I'd like to run against a remote server. When I run it, I get the error : Connecting to remote server failed with the following error message : The ...
0
votes
2answers
484 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
2answers
558 views

KQL Query to specify date range for Mailbox search?

I'm trying to verify some phone numbers using our exchange server with the following query to send the results to my inbox: Get-Mailbox | Search-Mailbox -SearchQuery “Body: '*XXX-XXX-XXXX*' OR ...
0
votes
2answers
538 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" ...
0
votes
2answers
484 views

Invoke command with IP address as Target server does not works at all

Please see the following command and with Trusted Hosts enabled, this does not work: Invoke-Command -ComputerName <IP address> -port 5985 -Credential (New-Object ...
0
votes
2answers
658 views

Set group permission on folder

I have a folder with lots of subfolders D:\Data\Subfolder1 D:\Data\Subfolder2 D:\Data\Subfolder3 D:\Data\Subfolder4 D:\Data\Subfolder5 ... I need to create three active directory groups ...
0
votes
2answers
516 views

Ban IP address based on X number of unsuccessful sql server login attempts?

Is it possible to expand on the idea presented in Ban IP address based on X number of unsuccessful login attempts? to encompass IP addresses for repeated failed sql server login attempts? There are ...
0
votes
2answers
78 views

Copying files from one machine to another

I'm currently generating documentation on one machine, and publishing it to a web server using the following commands in a script: net use "\\someShare" PASSWORD /user:username del /S /Q ...
0
votes
2answers
191 views

Invalid Cast on login type in Powershell

I am updating some powershell code to install Database Tables/stored procedures on a 64 bit machine. I keep getting an error when I try to assign the login type. Here is my current code. $login = ...
0
votes
2answers
613 views

How do I add an IP address to a users dial in tab within powershell

How do I add an IP address to a users dial in tab within powershell. I want to do it about a 100 times so I was hoping to use the ad cmdlets to perform the task reading from a csv file the account ...
0
votes
1answer
361 views

Is there a registry key change that will by-pass the Windows Domain Join Welcome page?

I'm scripting some Windows Server 2008 R2 builds using Power Shell. Some software needs to be installed after the server has joined the domain. Since I want to automate everything, I'm looking to ...
0
votes
1answer
613 views

How to retrieve names of all private MSMQ queues - efficiently?

How can I retrieve the names of all of the private MSMQ queues on the local machine, without using System.Messaging.MessageQueue.GetPrivateQueuesByMachine(".")? I'm using PowerShell so any solution ...
0
votes
1answer
262 views

Add a SQL user similar to a current user via PowerShell?

I'm slowly but surely perfecting a new user script. As it is, my script will do everything to add a new user to our domain, except one thing. We have an in-house program, webpage front end that ...
0
votes
1answer
186 views

Count open Office Word Files

I have troubles to find a solution for my problem (I am a really beginner of powershell). I have to count the Office files which are open on a server. My situation: A Service account is connected ...
0
votes
1answer
150 views

How to access shared folders

I have VPN tunnel between two computers and through WinSCP (or any other SFTP client) I can access shared folders. Is it possible to access them outside the SFTP client (in the OS)? I have to access ...
0
votes
1answer
102 views

Running external programs from PowerShell results in error. Why?

I have a PowerShell script that starts several external programs and batch files. All of calls worked fine on my Windows XP/PowerShell 2.0 machine. On a Windows Server 2003/PowerShell 1.0, however, ...
0
votes
1answer
123 views

Exchange Server 2010 SP1: Powershell scripting

How can I get a list of users that got the checkbox unchecked for advanced security "Allow inheritable permissions..." on the Exchange Server 2010 ? How can I enable it bulk using AD PowerShell?
0
votes
1answer
156 views

PowerShell -replace operator exhibits quirky behavior with particular data

The presence of the special PowerShell variable $_ in the replacement string causes odd behavior; I am wondering if there is something about escaping I am missing or if this is just a defect. The ...
0
votes
1answer
574 views

Has anyone used WMI_OfflineFilesCache::RenameItem to rename offline files?

The reason I ask is that I have been researching how to rename items once an offline files target has been changed. It seems that so far there are two options: CSCCMD.exe - Which appears to be a ...
0
votes
1answer
476 views

.Net SqlClient Data Provider error when comparing keys in powershell DB install

I am trying to install Databases on a new windows 7 machine with powershell code that was meant for windows xp. I have been able to fix most of the problems as I have come across them but I have been ...
0
votes
1answer
188 views

Uninstalling PowerShell 1.0

I am attempting to standardize our PowerShell deployment and usage across all servers, which involves uninstalling PS1.0/installing PS2.0 on Server 2003 machines. In searching for KB926139 through CMD ...
0
votes
1answer
351 views

Programmatically assigning an existing ssl cert to a website in iis6 via powershell or vbscript

I have the following powershell script that creates a new website in IIS6: https://github.com/dagda1/iis6/blob/master/create-site.ps1 Does anyone know how I can assign an existing ssl cert to the ...
0
votes
1answer
293 views

get-wmiobject failing across subnets?

We have two sites linked by a VPN handled by two dedicated Netgear VPN routers. Each side has a Win2003 domain controller. Each site can ping all the machines at the other. The domain controller ...
0
votes
1answer
304 views

Get-ChildItem fails to connect in SQLSERVER drive

I'm having some trouble with the SQLSERVER PSDRIVE. See error below. I only have named instances on my PC, both 2005 and 2008 Added the SQL snapins. The PC is named YODA The SQL instance is SQL2008 ...
0
votes
1answer
282 views

Getting error when trying to retrieve a security Descriptor from a Win32_Service class

I'm trying to retrieve the security descriptor of a Win32 Service. For that, I'm doing, in PowerShell, $sd = (Get-WmiObject -class Win32_Service | ?{$_.Name -like ...
0
votes
1answer
229 views

I would like to send the wifi wep key automaticaly to laptops on the lan via powershell

How do I send the wifi wep key automaticaly to laptops on the lan via powershell
-1
votes
1answer
184 views

portqry to check connectivity

Is it possible to check the connectivity between 2 remote servers using portqry given that the portqry.exe command is executed on another server. for example, check the connectivity between serverA ...
-1
votes
1answer
67 views

Automate Monitor string in different log files

I have few log files in different servers and I want to check output in the end of those log files for e.g . success: 4000 failed: 200 These logs files are getting generated daily and I have to keep ...