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

How to remove string and replace with content found in text file using batch script or powershell

How to remove string and replace with content found in text file using batch script. test.txt Version: 4.5.0 Import: //MPackages/Project/config/abc.txt #head ...
2
votes
1answer
89 views

Use Powershell to start a GUI program on a remote machine

There are two Windows 7 machines setup on the same network. I enabled everything needed so that they could communicate with winrm. When I run the following command: Invoke-Command -ComputerName ...
0
votes
1answer
50 views

Powershell script issue

I am having an error with the script below: $server_names = Get-Content "C:\ArchivedFolders.txt" Foreach ($server in $server_names){ Copy-Item "\\$server\C$\Mail\*" -Destination ...
2
votes
1answer
319 views

Powershell - Sort-Objects, list of IP Adresses

I got a /20 network and I want to know all used IP Adresses and their attributes like the MAC, the name and the description plus all free addresses between the used ones so that I got a long list ...
1
vote
1answer
46 views

Powershell service creation with ad credentials logon error

Powershell service creation with ad credentials issue I use the powershell below to create a service running with AD credentials. However when I run it I get an error messgage (also below). If I ...
-2
votes
2answers
37 views

Place Date in Description when moved to different OU [closed]

I am not sure if this is possible, but i am wondering if i could create a powershell script that would move any/all users listed in a CSV file to a different OU and add the date in the Desription ...
2
votes
3answers
19k views

How to get a list of all Distribution Lists and their Members in Exchange 2007?

I'm looking to get a list of all Distribution Lists in Exchange along with their members? Is this possible using any built-in Exchange tools? Powershell? Third party tools?
7
votes
1answer
180 views

How to edit Active-Directory Site properties via Powershell?

I am having trouble accessing the location property of my Active-Directory's Site via Powershell. (Windows Server 2012 R2) The following command returns no value: > (Get-ADReplicationSite ...
2
votes
1answer
33 views

How can I input password to manage-bde -pw option via windows powershell

I am trying to encrypt Data volume (for example E:) with the following command: manage-bde -protectors -add E: -pw When I execute the above command, it will ask for the password, so I entered it. ...
0
votes
2answers
3k views

powershell: use variable with wildcard with get-aduser

powershell newbie here. I am building a simple bit of code to help me find user's by entering letters of user names. How do I get a wildcard to work w/ a variable? this works: $name=read-host -prompt ...
1
vote
1answer
60 views

Powershell: A parameter cannot be found that matches

I am new to the Powershell world. Below is my first script $sServer = "Fully.Qualified.Computer.Name" $os = Get-WmiObject -class Win32_OperatingSystem -computername $sServer $object = New-Object ...
1
vote
2answers
1k 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
3answers
8k 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 {& ...
1
vote
1answer
193 views

NRPE (Winrpe) Powershell Command - Unable to read output in Nagios

I'm trying to run an Powershell script from NRPE.cfg and get the output in Nagios. When i run the script on the local (Windows) server, everything is just fine. But when i put it in the NRPE.cfg en ...
-1
votes
2answers
9k views

How To List All Computers Operating System On A Network In Powershell

I am looking for a script to show all the machines, hostnames, and OS versions on my domain. I have found a few scripts, but none of the scripts that I have found will do both. Here is an example of ...
1
vote
1answer
1k views

Exception Enumerating SQL Server Instances with SMO WMI ManagedComputer

I'm trying to use the SMO WMI API/objects in PowerShell 2.0 on Windows 7 with SQL Server 2008 R2 installed to get a list of SQL Server instances on the local computer using the Managed Comuter object. ...
2
votes
1answer
7k 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
188 views

PowerShell Script Not Running on Scheduled Task

I have been attempting to set up a PowerShell script to run as part of a scheduled task on a Windows Server 2012 R2 server. The script will run if I execute it manually from the GUI but all but one of ...
2
votes
1answer
43 views

Powershell v1 Search String from Variable

I am trying to search a variable which holds a list of files, gotten from get-childitem, and list all matches to a specific search string but can't seem to get the result I want, what am I doing ...
-1
votes
0answers
36 views

Variable values to pass from local computer to remote in Pssession [migrated]

I have a powershell script. Executing this will create a session with remote computer and execute some scriptblock inside remote computer. After that execution I need to send a mail. So, I get the ...
-1
votes
1answer
25 views

Office365 User Activity Tracking

I have a situation where a user's mailbox on exchange online enterprise sign-in was disabled as employee was on a suspension, however the mailbox was re-enabled upon employee returning to the office. ...
2
votes
1answer
82 views

Map Network Drive to a WebDAV Server via PowerShell

My goal is to map a network drive in Windows to a WebDAV server via PowerShell. I have a script that automatically creates an Azure VM with IIS installed and WebDAV configured. I can successfully map ...
6
votes
0answers
79 views

Powershell's equivalent to Bash's process substitution

Bash has <(..) for process substitution. What is Powershell's equivalent? I know there is $(...), but it returns a string, while <(..) returns a file the outer command can read from, which is ...
0
votes
1answer
2k 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 ...
1
vote
1answer
44 views

Windows remove DNS server

I have a DNS server that is misbehaving. Some of my windows machines only have 2 dns servers server01 192.0.2.1 server02 192.0.2.2 Some of my windows machines have 3 dns servers server01 ...
0
votes
0answers
27 views

Microsoft TMG - Firewall Client software on Win 7 hosts to bypass credential prompt

They're running Microsoft TMG at my current customer's site. I am a developer and use lots of online/cloud tools and make frequent HTTP requests to the internet. I'm continually managing proxy ...
2
votes
2answers
3k views

Installing Powershell 3.0 or 4.0 on Windows 7 machines through Group Policy or SCCM

I am trying to update all of the Windows 7 machines that we have in one of our OUs in Active Directory with either Powershell 3.0 or 4.0. I would like to use either Group Policy or SCCM 2012 and would ...
0
votes
0answers
21 views

How do I enable Get-MailboxFolder to work against other mailboxes?

Get-MailboxFolder by default seems to only work on one mailbox, that of the logged in user. I'm trying to leverage the Identity parameter of the cmdlet to connect to other mailboxes. I discovered ...
2
votes
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 ...
-2
votes
1answer
58 views

How to remove Powershell from Windows Server 2012? [closed]

I want to remove Powershell from Windows Server 2012. I have removed it in Windows XP by removing its updates. Also, when I removed Powershell from "Remove Role and Feature" I lost my GUI! Would you ...
0
votes
0answers
25 views

Identifying mailboxes with corruption Exchange 2013

We're preparing to rid ourselves of Exchange on-premise and are migrating from an outsourced hosting provider to go to Office 365. We're running a fully patched version of Exchange 2013, atop Server ...
2
votes
2answers
13k views

Grant MODIFY on “All Subfolders and Files” with icacls, but only give Read to top level folder

One of our Windows servers that has some user folders on it has some pretty screwed up permissions. What I want it for SYSTEM and Domain Admins to have full control of all folders. I want the users to ...
1
vote
0answers
25 views

Error in getting powershell remote session through ssh-enabled PowerShell

I am trying to login to windows 2008 server "C" from my machine "A". There is machine in between "B" serving as jumpbox running windows server 2008 and running "SSH-Enabled PowerShell Access for ...
0
votes
0answers
1k views

Powershell Script to Zip Files

I'm new to Powershell. I have a need that I assumed that it would be perfect for. However, I've quickly come to the point where I feel I'm in over my head. Basically, I need to create a .zip file. I ...
0
votes
2answers
923 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 ...
1
vote
1answer
1k views

Exch2010 - Remove ActiveSyncAllowedDeviceIDs for devices with no activesyncdevice

I have users with multiple ActiveSyncAllowedDeviceIDs, who only have 1 ActiveSyncDevice partnership. Note the android-deviceid is a real phone and testdevicepleaseignore is a device that was removed ...
4
votes
2answers
1k 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 | ...
0
votes
1answer
923 views

DPM 2012 running powershell script in task scheduler

I'm having a problem running a custom PS script I created to attach systems into the console. My PS script works when i'm running it interactively in the DPM Management Shell. I was referencing this ...
91
votes
10answers
87k views

How to zip/unzip files in Powershell?

Is there a one-liner that will zip/unzip files (*.zip) in PowerShell?
1
vote
1answer
44 views

powershell sccm import-module error

Have downloaded the sccm powershell module from https://www.microsoft.com/en-us/download/details.aspx?id=46681 Installed via the .msi no issues. On import, like so: > Import-Module ...
0
votes
3answers
1k 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
0answers
35 views

How to add a data disk to a vm in resource manager using the resource group template file?

I would like to provision a server with azure resource manager that has a data drive. What json do I add to my azure resource group template file in order to provision the server with a persistent ...
1
vote
2answers
87 views

PowerShell persistent connection during remoting

I'm having a hard time understanding persistent connections in PowerShell during remoting sessions. I created my persistent connection and created a variable to test its lifespan: $session = ...
2
votes
4answers
8k views

How to unhide hidden NTFS folder? (option greyed out, maybe it's a system hidden folder)

I have this perplexing folder that I'm the "Owner" and I have all NTFS rights on it: it's invisible. I would like to make it visible without having to check the "Hide protected operating system files" ...
4
votes
3answers
21k views

Writing a powershell script to copy files with certain extension from one folder to another

I would like to write a powershell script that gets the following parameters as input: Folder to copy from, extensions allows, folder to copy to and a boolean indicating if the change should restart ...
9
votes
2answers
3k views

How can I compare installed hotfixes between two Windows servers using PowerShell?

I need to compare the installed patches between a dev and production environment using PowerShell. How can I do this?
2
votes
3answers
2k views

Powershell - Find users belonging to more than one AD group

I'm new to AD and Powershell so please forgive me if I use the wrong terminology. I have a series of 50+ Active Directory groups called "ABC-something". Every active user needs to belong to exactly ...
-1
votes
2answers
45 views

Add user to a group in Active Directory using powershell

I am trying to add a user to a group in AD using powershell. I am using the following command: Add-ADGroupMember -Identity ...
2
votes
1answer
35 views

ADDS: Mandatory Profiles through powershell

Intro I'm a networking student from Belgium and I just got assigned a big project. Basicly i'm responsible for the ADDS. We have to create several OU's and every OU needs at least 20 users or more. ...
2
votes
0answers
40 views

Adding multiple users from a group to an Active Directory group using Powershell

I have a powershell script that is supposed to go through a specific ou and store the groups into a variable $groups. Here is the code I use in the script: $Groups = Get-ADGroup -Properties * ...