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)

1
vote
1answer
508 views

PowerShell Copy-Item Method Fails

I am trying to use PowerShell (v.1) to copy over only files that match a pattern. The file naming convention is: Daily_Reviews[0001-0871].journal Daily_Reviews[1002-9887].journal [...] When I run ...
1
vote
2answers
132 views

Pattern Matching with PowerShell 1

All, I am new to Windows admin-type stuff but I am familiar with Unix/Linux, etc. I have a simple PowerShell 1 script that should only copy files that match this naming convention: ...
2
votes
2answers
6k views

Using Powershell to bulk change the Home folder path of AD objects - %username"?

I have done a lot of searching on this, and still cannot find the answer. I have created a script which will bulk move all user objects in one OU to another OU. This works fine. Now I am trying to ...
2
votes
1answer
2k views

Powershell: Understanding Printer DACLs

I'm attempting to read and eventually write the DACLs for printers shared from my print server. Here's what I have so far, based on scripts found around the internet: $pace = DATA { ...
4
votes
1answer
3k views

How do I run commands on a remote machine with admin privilege using powershell

How do I run commands on a remote machine with admin privilege (example: running as Run as Administrator) using PowerShell. So far I have tried start-process powershell.exe -verb runas ...
5
votes
2answers
2k 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 ...
1
vote
1answer
2k views

The value of property “UserPrincipalName” is used by another recipient object

I'm stuck in some sort of strange loop. I tried to create an office 365 user, and did not have any available licenses. I followed the link to purchase an additional license, then went back and ...
2
votes
1answer
37 views

Alternative for Obsolete -VhdDestinationPath Parameter

I am trying to import a virtual machine with PowerShell and I want to specify which folder the VHD file should be placed in. According to http://technet.microsoft.com/en-us/library/hh848495.aspx the ...
-1
votes
1answer
200 views

Some regex for powershell [closed]

I have below sample file(s). Symmetrix logical device count=13 CLARiiON logical device count=0 Invista logical device count=0 Generic logical device count=0 ...
0
votes
0answers
395 views

PowerShell doesn't like the -AssignDriveLetter option of the New-Partition cmdlet

I'm trying to create a partition on the USB flash drive using the New-Partition cmdlet. But when I use the -AssignDriveLetter option I get "New-Partition : Invalid Parameter" even though this option ...
1
vote
0answers
428 views

Cannot create partition on disk using PowerShell: “New-Partition : Not enough available capacity”

I'm trying to create two partition on the USB flash drive. The first small 350Mb partition is created fine, but the second throws "New-Partition : Not enough available capacity" even though there is a ...
1
vote
0answers
378 views

Cannot initialize disk in PowerShell : Initialize-Disk throws “The disk has already been initialized”

I'm trying to change the flash drive's partition style to GPT using PowerShell, but the cmdlet throws "The disk has already been initialized" (even though I've cleaned the drive): PS ...
3
votes
3answers
2k views

Export Windows Server configuration to powershell script?

I'm looking for a way to export role/feature configuration to a scriptfile, like powershell. Lets say you've installed the DHCP-Role. You configure the scopes, reservations and all that stuff you ...
4
votes
2answers
1k views

Why can a Domain Admin run a powershell cmd locally, but connecting over WinRM with the same account, command returns an UnauthorizedAccessException?

I'm trying to administer a Windows 7 machine remotely. I've enabled WinRM and can use Enter-PsSession to connect to the remote machine. However, I'm noticing a difference between running a particular ...
0
votes
1answer
147 views

Windows: Remote Display Back in Powershell a la X11?

If I have two Linux boxes, A and B, I can SSH from A to B with X11 forwarding enabled. This allows me to use graphical applications on B and have the display rendered on Machine A. Is there a way to ...
4
votes
1answer
542 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
388 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
336 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
464 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 ...
1
vote
1answer
415 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
786 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 ...
1
vote
1answer
143 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
152 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
379 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
1k 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
4k 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
497 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
878 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
455 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 ...
3
votes
2answers
3k 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 ...
5
votes
1answer
4k 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
214 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
231 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 ...
2
votes
1answer
2k 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
79 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
96 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
2k 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
220 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
522 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
716 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
539 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
844 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 ...
1
vote
1answer
507 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
935 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
73 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
303 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
504 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: ...
1
vote
1answer
231 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
1k 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: ...
2
votes
1answer
2k 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 ...