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

PowerShell: Copy-GPO failing with HRESULT: 0x8007000D

While trying to run the Copy-GPO cmdlet to copy a Group Policy Object using a predefined Migration Table I am receiving this exception: System.Runtime.InteropServices.COMException (0x8007000D): The ...
1
vote
1answer
507 views

Batch rename files using PowerShell or other

I have a folder of images taken on two different mobile phones. The two phones use slightly different file name formats. I want to change one of them to match the other so I have a neat photo album. ...
1
vote
1answer
594 views

Running SSH command within a scheduled task

I have simple powershell script which gets the offset of a Ubuntu server with the time of the NTP server. The command I run is $result = ssh -i C:\temp\privatekey domain\username@servername "...
2
votes
1answer
777 views

Powershell V1 v V3 - Pop-Up windows gone

When I did $name = Read-Host 'What is your name?' in Powershell V1 it would ask the question in a pop-up window. With Powershell V3 it just asks in the console window. Is there a way to force Read-...
2
votes
1answer
670 views

Powershell - how to Start-Job with an ActiveDirectory credential

My client controls access to their database with ActiveDirectory. I would like to do the following: $cred = Get-Credential Start-Job -Credential $cred { #do some stuff with the db } This works ...
0
votes
1answer
1k views

Need equivalent of command with nmap, awk and grep for Windows machines with PowerShell and/or Perl

Please see this thread for reference How can I scan using nmap and Zenmap all hostnames that begin with a particular string? One of the answers in the thread above uses the following query (I take ...
2
votes
1answer
255 views

How can I merge the output of two amost identical powershell commands?

I'm monitoring the counnection count for each of my CAS servers and would like to concatenate the output of each of them so I can display it cleanly. I've tried "adding" the results as in $rpc = $rpc ...
1
vote
1answer
159 views

Automating windows server 2008 installation in hyper V with powershell

I often set up servers in Hyper V on my laptop (running windows server 2008) to test varoius software. Is there a way in powershell to build an image in Hyper V and run windows update on that image? ...
2
votes
2answers
1k views

I need to list all users in Active Directory that do not have any data in the NAME field, using PowerShell

I need to list of all users in AD that do not have any entry in the NAME field (example: smith,jon) So far I have something like below Get-ADUser -filter {Name -eq " "} | FT SamAccountName I know ...
5
votes
1answer
2k views

Exchange 2010 Auto-mapping mailboxes feature doesn't work when groups grant permissions

I have a shared mailbox that I need to deploy to one of our departments in an Exchange 2010 SP2 environment with Outlook 2010 clients. I'm trying to rely on the auto-mapping feature introduced by ...
1
vote
2answers
7k views

How to rename bunch of users' DisplayNames using Powershell in Exchange 2010?

I have bunch of users which DisplayNames I changed mistakenly to some string (for example: xyz) But there is one field called Name which has FirstName and Lastname. What I want is take all users who ...
1
vote
1answer
1k views

Script to Uninstall MS Updates by Date

I'm in a situation where I need to uninstall all windows updates before a certain date to troubleshoot a strange bug. I found several vb/ps scripts to do this remove single update However I'm ...
1
vote
1answer
1k views

SCCM 2007 Powershell “Update Collection Membership”

Is there Powershell command/script that can be setup to run an "update collection memebership" on a specific collection and subcollections? If not Powershell another way besides right click on ...
3
votes
1answer
665 views

Systems Center service template including AD

I'm trying to design an SCVMM (2012 SP1) service template that contains several machines joined in a domain, but the trick is that the very domain controller is also in the template. Ie. the template ...
6
votes
3answers
6k views

How to get a list of emails older than 2 years in Exchange Database, sorted by user, using Powershell?

We are currently looking at archiving emails and revamping our retention policy. The big question is (for the legal department), how far back do we want to save? Currently our users have a huge ...
6
votes
1answer
10k views

Rename displayName and CN from givenName and surName with Powershell?

I need to reconcile the displayName and CN attributes to the givenName and surName fields in AD. Is it possible to take givenName and surName and rename both the displayName and CN using Powershell?
0
votes
1answer
325 views

Hyper-V and Windows Server with Powershell/Automated?

So my work is looking into Automating Hyper-V Servers for Test Environments, Basically in the end we want to have a sort of Web/Form interface for selecting a server spin up. Right now it's done ...
1
vote
1answer
286 views

PowerShell: replacing AD DS ACLs

I am looking for a code sample showing how a permission set on a given Active Directory object (in my case an Organizational Unit) could be modified in a way where permissions for a given security ...
4
votes
1answer
3k views

Powershell remoting to a server using CNAME, not COMPUTER NAME

I am trying to get powershell remoting to work with a server using it's CNAME rather than the computer name. Both local and remote machines are on the same network and domain. I have enabled ...
2
votes
1answer
108 views

How Can I Source My $Profile From A Powershell Function?

I like to make a lot of changes to my $profile file. After saving a change, I would like to source the file using an "sop" alias. Here's how I hope to accomplish that: set-alias sop Source-Profile ...
1
vote
1answer
118 views

Is Microsoft .NET Framework Client Profile enough for PowerShell to work on a Windows XP workstation?

Is Microsoft .NET Framework Client Profile enough for PowerShell to work on a Windows XP workstation? Or is a full .NET version needed to be installed? Are there any advantages for the full ...
0
votes
1answer
4k views

Remotely execute application on another PC connected via a crossover cable

I have two PCs that are both running Windows XP SP3, referred to as PC1 and PC2. They are connected to each other through cross-over ethernet cable. PC1 has the static IP address 10.0.0.1 and PC2 has ...
3
votes
1answer
284 views

How can I add a user's domain information to the pipeline in PowerShell when using Get-ADUser?

I'm trying to enumerate the name, samaccountname, and domain that each user in my forest belongs to and write it to a text file. The script that I have now is: Import-Module ActiveDirectory $...
1
vote
1answer
885 views

Access Denied when creating a scheduled task with powershell and the com schedule.service object

I have a powershell script that creates a scheduled task using a call to RegisterTask via the Schedule.Service com object. Essentially: $ts = new-object -com Schedule.Service $ts.Connect() $...
0
votes
1answer
1k views

Powershell script to insert SQL Statement with a apostrophe error

I have the following part of a script that takes objects form Exchange and AD and inserts into a MYSQL table. But some of the Full Names variables have a ' like the distribution group PA's. Here's ...
0
votes
2answers
790 views

Powershell backup log to csv

Hi I have learned a short command to create a CSV from the backup log on my server. I have 5 of them and I wonder if there is a way to show their result in a website format on one pages. The whole aim ...
0
votes
1answer
2k views

Get Undeliverable Email Addresses Using Powershell

Exchange Server 2010 I am trying to use Powershell to get the email addresses that were returned as Undeliverable. I've tried a bunch of Powershell commands, but I always get the postmaster@domain....
1
vote
1answer
744 views

Use PowerShell to edit a remote file on a Windows 2008 Server

Editing a file on a remote linux server via SSH and vim is something I usually do on a regular basis. Recently, I got on a new web project involving Microsoft technologies instead of the usual open ...
0
votes
1answer
2k views

Newbie. ForEach, IF, Else

Please educate me. I am trying to test if a file exists on a group of computers' desktop. Some computers are Windows 7 and some are Windows XP. When I run the code, It doesn't test the path on every ...
0
votes
1answer
78 views

single or set of patches from windows update?

Is there a way to install several patches by kb or other means and only install those specific without manually downloading the patches? I want to use automatic update services but don't want every ...
1
vote
3answers
676 views

Does Windows 2012 Server needed to be a Domain Controler for Using it as AD Webservices for Powershell

I am trying to achieve the make use of AD administrative commands such as "Get-ADUser" and "Get-ADComputer" via Powershell. All our domain controllers are Windows 2003 and we have one Windows 2012 ...
1
vote
1answer
931 views

Toggling enabled/disabled on specific triggers in a task in the task scheduler using powershell (or something else)

Related to this question: Windows Server in UTC, need Task Scheduler to shift tasks with summer time and this question: http://stackoverflow.com/questions/11458029/enabling-disabling-tasks-in-task-...
2
votes
1answer
335 views

Discrepancy between Event Log taken from Powershell and with Event Log Viewer

Domain Controller OS - Window Server 2008 R2 Please see the First PrintScreen attached (Powershell.png). with the help of Powershell command I am trying to check the event Log of my DC. Please note ...
1
vote
2answers
2k views

Trying to set COM+ application component properties in PowerShell

I have this script where I'm trying to set the IISIntrinsic property for components of an application in Com+ in Component Services. This is what I'm trying to tick Here's my powershell script: $...
3
votes
1answer
5k views

How to take ownership of a security group as the Exchange administrator?

We are using Exchange 2010 as part of an Office 365 subscription. We have a security group owned by Alice only. Without using Alice's account, how can the administrator take ownership of that security ...
1
vote
2answers
753 views

How do I write a powershell script to install RDS-RD-Server role?

I assumed I would just put the following in a filename.ps1 named file and run it like: powershell.exe -noexit 'filename.ps1' It runs, but it's not doing anything. Inside the filename.ps1 I have ...
3
votes
1answer
4k views

How can I run a PowerShell script during the specialize pass of a WDS deploy?

I'm setting up Windows Deployment Services (WDS) for Windows Server 2012 unattended deployments using the default boot.wim file found on the install media. I have a PowerShell script that performs ...
3
votes
1answer
438 views

Exchange - limit enrollment of ActiveSync devices

Is it possible to modify an ActiveSync policy to prevent a user from having more than one (or any specified number of) device(s) enrolled simultaneously? What would be the Powershell script to do so? ...
6
votes
1answer
7k views

How can I get the “description” attribute of an OU in ActiveDirectory?

I'm working on a set of script that will be used to migrate the users and structure from one active directory to another. For this, I'm using the Get-ADOrganizationalUnit commandlet to export the OUs ...
2
votes
2answers
671 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 ...
0
votes
1answer
112 views

Commands to manage services and applications in a failover cluster

There is a pretty decent suite of Powershell commandlets for managing Microsoft Failover Clusters, including commands for starting and stopping nodes. However, I am interested in the equivalent ...
1
vote
2answers
5k views

Mailboxes moved and whitespace isn't increasing… aka logical mailbox space not being freed

I understand the difference between "logical" and "physical" free space and have a problem with whitespace not increasing (logical space, formerly event 1221 in Exchange 2003). Given that I have ...
0
votes
2answers
736 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 ...
1
vote
1answer
650 views

How to give “only append” access to user in windows , for logging purposes

I have a powershell script which takes some data and dumps into a logfile whenever its executed.The script resides in single location and shortcut is distributed to all. I want to log the events on ...
0
votes
1answer
218 views

Powershell script to bulk import PSTs into mailboxes based on primary smtp address

I have about 30 PST files which I need to import into mailboxes in Exchange 2010. They are all named by the first part of the email address. For example with johnsmith@domain.com, that PST would be ...
2
votes
2answers
761 views

powershell call operator with multiple arguments?

I am trying to use the powershell call operator to essentially run the following command: "C:\Program Files (x86)\PuTTY\plink.exe" "-v -agent -m C:\Scripts\idrac_powerup_commands.txt root@[servername]...
3
votes
3answers
2k views

Permissions Issue? Putty + Plink + Pageant + Powershell + Scheduled Task

Background I have the following components: A windows server 2008 R2 box An administrator account (mine) A service account on the domain that is an Administrator of the box An installation of ...
1
vote
1answer
252 views

powershell behavior of select

Can someone explain, why this ( powershell 2.0 ) $wmi=Get-WmiObject Win32_UserProfile $wmi|select *; $wmi|select SID; $wmi|select LocalPath; gives expected results ( selected everything, then ...
0
votes
6answers
3k views

Can I schedule machine boot via Dell iDRAC?

I have a Dell PowerEdge R410 with iDRAC 6 configured and accessible. I know we'll be losing power at some point this weekend and I have a time that I would like to power on the machine again. From ...
1
vote
1answer
7k views

How to change all users Ad Email contact using powershell

I need a script that will change all of my ad users email contact field information. The format will be the "SAMAccountName + @domain.com". I am a powershell noob and need a little help on the syntax. ...